Coder Social home page Coder Social logo

global-tunnel's People

Contributors

bendingbender avatar fernomac avatar stash avatar stash-sfdc avatar svc-scm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

global-tunnel's Issues

Why are localhost requests redirected to proxy ?

Hi all,

I have an issue with localhost requests. My node.js app needs to get data from both outside (Internet) and localhost. Internet requests are working fine through the proxy but even localhost requests are also sent to the proxy which is not normal.

Is there any parameter to ignore localhost requests?

Here's my config :

var globalTunnel = require('global-tunnel');

globalTunnel.initialize({
  host:'ProxyIP',
  port:3128,
  protocol:'http:',
  tunnel:'both'
});

Many thanks in advance.

throw new TypeError('Request path contains unescaped characters.');

Without the global-tunnel my code connects directly to the endpoint fine but when I enable global-tunnel via a MockServer proxy then I am getting the following error:

_http_client.js:54
throw new TypeError('Request path contains unescaped characters.');
^

TypeError: Request path contains unescaped characters.
at new ClientRequest (_http_client.js:54:11)
at TunnelingAgent.exports.request (http.js:31:10)
at TunnelingAgent.createSocket (/home/test/NodeApps/node_modules/global-tunnel/node_modules/tunnel/lib/tunnel.js:116:25)
at TunnelingAgent.createSecureSocket as createSocket
at TunnelingAgent.addRequest (/home/test/NodeApps/node_modules/global-tunnel/node_modules/tunnel/lib/tunnel.js:80:8)
at new ClientRequest (_http_client.js:139:16)
at Object.exports.request (http.js:31:10)
at Object.globalTunnel._defaultedAgentRequest (/home/test/NodeApps/node_modules/global-tunnel/index.js:211:38)
at Object.exports.request (https.js:173:15)
at Object.globalTunnel._defaultedAgentRequest (/home/test/NodeApps/node_modules/global-tunnel/index.js:211:38)

Not working with Node version 0.12.0

Module works perfectly well with Node 0.10.X but not working with latest node version which is 0.12.0. However I can't see any errors either.

Should treat HTTP_PROXY just like http_proxy

The de facto environment variable is http_proxy which is odd since almost every "official" environment variable is in all-caps. Support HTTP_PROXY as a fallback if http_proxy isn't set. Likewise for https_proxy.

Allow tunnelling via HTTPS too

Currently only the *OverHttp methods of tunnel are used. It would be nice to have *OverHttps work too! Bonus points: https_proxy environment variable support.

Working behind the corporate proxy

I had a problem in using strider CD. See Issue Strider-CD/strider#902
I placed console.log statements and found out that the path that is constructed in the tunnel.js is incorrect.

I updated with the latest version of tunnel module and now the above error went. But, still I am unable to connect successfully.

My corporate proxy's format is:
http://userid:[email protected]:PORT

I have set the above to http_proxy environment variable.

I will list out the methods I tried and the resulting scenarios.

Method 1: In main.js, I directly gave

globalTunnel.initialize();

I get the following error in the console.

2016-02-22T14:25:21.745Z - info: { host: 'proxy.company.com',
  port: 8080,
  protocol: 'http:',
  innerProtocol: 'https:',
  method: 'CONNECT',
  path: 'raw.githubusercontent.com:443',
  agent: false }
2016-02-22T14:25:22.053Z - error: Error: tunneling socket could not be establish
ed, cause=Parse Error
    at ClientRequest.onError (C:\Users\772466\Desktop\strider-master\strider-mas
ter\node_modules\global-tunnel\node_modules\tunnel\lib\tunnel.js:164:17)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketOnData (_http_client.js:310:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
    at TCP.onread (net.js:523:20)
GET /admin/plugins 500 357.279 ms - -
GET /favicon.ico 200 3.855 ms - -

The connect options looks like this:

{ host: 'proxy.company.com',
  port: 8080,
  protocol: 'http:',
  innerProtocol: 'https:',
  method: 'CONNECT',
  path: 'raw.githubusercontent.com:443',
  agent: false }

Though, I gave http://userid:[email protected]:PORT format to the http_proxy variable, I am getting a different format in the connect options. Is this correct?

I am not sure whether it is because of the above problem, but I get "tunneling socket could not be established, cause=Parse Error"

Also, have a look at my .npmrc file.

proxy=http://userid:[email protected]:PORT
https-proxy=http://userid:[email protected]:PORT
registry=http://registry.npmjs.org/
strict-ssl=false

Method 2: In main.js file, I gave

globalTunnel.initialize({
  tunnel: 'neither',
  host: 'http://userid:[email protected]',
  port: 8080
});

Now, I am getting the following error in the console.

2016-02-22T14:19:44.401Z - info: { host: 'http://userid:[email protected]',
  port: 8080,
  protocol: 'http:',
  innerProtocol: 'https:',
  method: 'CONNECT',
  path: 'raw.githubusercontent.com:443',
  agent: false }
2016-02-22T14:19:44.415Z - error: Error: tunneling socket could not be establish
ed, cause=getaddrinfo EAI_FAIL http://userid:[email protected]:8080
    at ClientRequest.onError (C:\Users\772466\Desktop\strider-master\strider-mas
ter\node_modules\global-tunnel\node_modules\tunnel\lib\tunnel.js:164:17)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketErrorListener (_http_client.js:259:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at connectErrorNT (net.js:996:8)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)
GET /admin/plugins 500 58.205 ms - -
GET /favicon.ico 200 3.671 ms - -

I am getting the getaddrinfo EAI_FAIL error.

I have fiddled with all the npm configuration options and the code, but of no use. What am I doing wrong here?

All requests to proxy are http://[object Object]:undefined

I installed the global-tunnel npm module and initialized the proxy as instructed in the docs:

var globalTunnel = require('global-tunnel');

globalTunnel.initialize({
  host: '127.0.0.1',
  port: 8888,
});

Requests are being routed to the proxy (Charles) just fine, however they all show up as http://[object Object]:undefined and are obviously failing.

How to use NO_PROXY env variable

I need ability to do direct calls for local addresses. How to make global-tunnel module read NO_PROXY env variable and make direct calls if url is pointed to intranet?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.