Comments (11)
My testing shows this example does work in version 0.3.1 but not 0.4.1, 0.4.2, or 0.5.0.
from node-http-proxy.
See #39 for potential resolution
from node-http-proxy.
I will roll this into v0.5.1
. This code was a workaround for a small bug in node.js core that @mikeal fixed this here nodejs/node-v0.x-archive@2b03ba5#lib/http.js
Although this commit claims it was made in February, when I released 0.5.0
it was not in the node.js source. Rebased perhaps?
from node-http-proxy.
Uh oh, looks like the clock on my VM may be off. This could be bad...
Thanks for letting me know!
Tim
On 4/26/2011 5:20 PM, indexzero wrote:
I will roll this into
v0.5.1
. This code was a workaround for a small bug in node.js core that @mikeal fixed this here nodejs/node-v0.x-archive@2b03ba5#lib/http.jsAlthough this commit claims it was made in February, when I released
0.5.0
it was not in the node.js source. Rebased perhaps?
from node-http-proxy.
yeah, this was just a few weeks ago, i don't know why it has that date on it.
from node-http-proxy.
Oh, I thought you meant my commit.
Mine should be:
Date: Tue Apr 26 12:27:24 2011 -0400
Not sure why that other one would have a strange date.
Tim
On 4/26/2011 5:22 PM, mikeal wrote:
yeah, this was just a few weeks ago, i don't know why it has that date on it.
from node-http-proxy.
THEN THE KILLER INTERACTIVELY REBASED THE COMMIT HISTORY
from node-http-proxy.
i think i know what happened.
i wrote this patch for v0.4.x, but it's not forward compatible with earlier 0.4.x releases so Ryan rolled it in to master, it probably conflicted and so he rebased.
from node-http-proxy.
I figured something like that. Not a problem. I'll make sure to put >= node 0.4.7
on the requirements for node-http-proxy >= 0.5.1
from node-http-proxy.
I just made a clean npm install node-http-proxy, and I am using node0.5.0pre. I get the same error, I thought this was resolved long time ago?
http.js:1455
throw new TypeError('Invalid argument to getAgent');
^
TypeError: Invalid argument to getAgent
at Object.getAgent (http.js:1455:11)
at _getAgent (/home/ubuntu/server/js/server/node_modules/http-proxy/lib/node-http-proxy.js:48:30)
at [object Object].proxyRequest (/home/ubuntu/server/js/server/node_modules/http-proxy/lib/node-http-proxy.js:410:12)
at Server. (/home/ubuntu/server/js/server/node_modules/http-proxy/lib/node-http-proxy.js:155:13)
at Server.emit (events.js:67:17)
at HTTPParser.onIncoming (http.js:1119:12)
at HTTPParser.onHeadersComplete (http.js:108:31)
at Socket.ondata (http.js:1018:22)
at Socket._onReadable (net.js:684:27)
at IOWatcher.onReadable as callback
from node-http-proxy.
This seems to be something (still) going on in Node.js core. The code in questions claims that it is backwards compatible: https://github.com/joyent/node/blob/master/lib/http.js#L1427
Perhaps @ry or @mikeal could shed some light on why this is popping up again. Host is still being passed as a string in node-http-proxy (i.e. "legacy" arguments) https://github.com/nodejitsu/node-http-proxy/blob/master/lib/node-http-proxy.js#L48
I think that this may be a bug in core related to options instanceof String
. This syntax doesn't seem to be the correct way to identify the type of the argument. Here's a quick sample from the REPL:
'foo' instanceof String
false
typeof 'foo' == 'string'
true
Should be a quick fix. Reasonbly sure this has nothing to do with node-http-proxy.
from node-http-proxy.
Related Issues (20)
- Is it possible I run the proxy in this way? HOT 2
- (bug) isSSL regex is NOT doing what you think it's doing. HOT 1
- Proxy failed
- Get the response data from target server with express
- With "toProxy" the url recieved by the proxy server has a "/" prefix HOT 3
- Using cert auth results in `SSL alert number 46` HOT 1
- Proper way to handle error HOT 2
- Content-type Header Not Handled Correctly for JSON and Form Data with Charset Information
- Add blacklist headers to protect against DoS attack
- Resolving Digest Auth challenge in middleware using events? HOT 1
- Reverse Proxy Randomly Hangs for Larger Data When Running With Bun Runtime HOT 1
- Proxy don't work when switch target URL to object
- RSSI List
- UNMAINTAINED WITH SECURITY ISSUES
- How to forwarding a request when the proxy not found . HOT 1
- Single use proxy in multi-tenant application
- How to detect which client is receiving the package?
- Please fix version of Library "follow-redirects" to eliminate CVE-2023-26159 issue HOT 3
- Contact point or SECURITY.txt file
- Is the repo still developing actively ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-http-proxy.