Are you trying to connect outside of localhost? That is not what
zombiejs is for. From the docs:
Browser.localhost(host, port)
Allows you to make requests against a named domain and HTTP/S port, and
will route it to the test server running on localhost and unprivileged port.
For example, if you want to call your application "
example.com", and
redirect traffic from port 80 to the test server that's listening on
port 3000, you can do this:
Browser.localhost('
example.com', 3000)
browser.visit('/path', function() {
console.log(browser.location.href);
});
=> '
http://example.com/path'
Thus you can have your web application running on whatever port and
internally your tests can use a sensible domain/path URL (to emulate a
real browser).
HTH
–J
On 1/19/17 11:42 AM, cOborski wrote:
> I can't seem to connect to any website using zombie.js, this is the code
> I'm using:
>
>
> const http = require('http')
>> const Browser = require('zombie');
>> var browser = new Browser();
>> Browser.localhost('
google.com', 80); // I've tried a number of different
>> sites and different ports as well as
http://google.com,
>>
https://google.com...
>> browser.visit("/", function(err) { //I've also tried different paths ex.
>> /#q=zombie.js
>> if (err) {
>> throw (err.message)
>> };
>> });
>
>
> I always get the error:
>
> throw error;
>> ^
>> connect ECONNREFUSED
127.0.0.1:80
>