GithubHelp home page GithubHelp logo

Comments (11)

timmattison avatar timmattison commented on May 13, 2024

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.

timmattison avatar timmattison commented on May 13, 2024

See #39 for potential resolution

from node-http-proxy.

indexzero avatar indexzero commented on May 13, 2024

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.

timmattison avatar timmattison commented on May 13, 2024

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.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.

mikeal avatar mikeal commented on May 13, 2024

yeah, this was just a few weeks ago, i don't know why it has that date on it.

from node-http-proxy.

timmattison avatar timmattison commented on May 13, 2024

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.

indexzero avatar indexzero commented on May 13, 2024

THEN THE KILLER INTERACTIVELY REBASED THE COMMIT HISTORY

from node-http-proxy.

mikeal avatar mikeal commented on May 13, 2024

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.

indexzero avatar indexzero commented on May 13, 2024

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.

manast avatar manast commented on May 13, 2024

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.

indexzero avatar indexzero commented on May 13, 2024

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)

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.