Harshit
Harshit

Reputation: 721

Frisby.js Error: tunneling socket could not be established

I am trying to test an REST API on my local machine using frisby.js . It throws the following error.

Error: tunneling socket could not be established.

The machine address is something like 'https://machine_name:8443'

Upvotes: 0

Views: 393

Answers (1)

leo.fcx
leo.fcx

Reputation: 6467

It seems that you are behind a proxy. Then, to make your frisby test working, you need to apply proxy configuration as follows:

var frisby = require('frisby');

frisby.globalSetup({
    request: {
        proxy: 'http://xx.xx.xx.xx:yyyy' // Provide proxy info (host, port) here
    }
});

frisby.create('Your spec description here')
    .get('https://machine_name:8443')
    .expectStatus(200)
    .toss();

Note also that you are using HTTPS protocol. Then you may find useful my answer in this post in case you have problems with SSL certificates

Upvotes: 1

Related Questions