salesforce / global-tunnel Goto Github PK
View Code? Open in Web Editor NEWDeprecated, please see:
Home Page: https://github.com/np-maintain/global-tunnel
License: BSD 3-Clause "New" or "Revised" License
Deprecated, please see:
Home Page: https://github.com/np-maintain/global-tunnel
License: BSD 3-Clause "New" or "Revised" License
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.
Please add support for TCP Proxy for net.connect
Is there any option to provide proxy username and password ?
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)
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.
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
.
Salesforce is in the process of migrating all repositories from github.com/SalesforceEng to github.com/salesforce. As a part of this migration, this repository is slated to be moved as well. To request an exception or for any concerns contact @SalesforceEng/osscore or email [email protected]. There is no set date for the migration yet. For details on how GitHub repository transfers work, see here. Posted at 2016-08-23 22:43:41 PST.
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.
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?
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.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.