Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket proxy does not complete #444

Closed
srossross opened this issue Jul 25, 2013 · 19 comments
Closed

Websocket proxy does not complete #444

srossross opened this issue Jul 25, 2013 · 19 comments

Comments

@srossross
Copy link
Contributor

I am using http-proxy to proxy to the socket.io driven app tty.js

The socket does not seem to be connecting most of the time. 1 of 5 times I refresh the page it connects, otherwise I see Text Status: Pending for the websocket, in chrome developer tools:

I am using:

  • Amazon EC2 linux: $uname -a Linux ip-10-236-133-58 3.4.37-40.44.amzn1.x86_64 #1 SMP Thu Mar 21 01:17:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
  • Either node v0.10.13 and node v0.6.21
  • http-proxy@0.10.3
@srossross
Copy link
Contributor Author

The commands I am using are:

  • node ./bin/tty.js --port=4003
  • node ./bin/node-http-proxy --target localhost:4003 --host 0.0.0.0 --port 2228

@glasser
Copy link
Contributor

glasser commented Jul 25, 2013

Websocket proxying is broken in Node 0.10, see #387 (which is incorrectly closed). It is obviously broken in http-proxy 0.10.1 and subtly broken in http-proxy 0.10.2.

I'm keeping all my work (eg, meteor) on 0.8 (and keeping http-proxy at 0.10.1) until this is fixed. There is some work being done on the 0.10.x branch to fix this, which is great.

@srossross
Copy link
Contributor Author

Websocket proxying is broken in Node 0.10, see #387 (which is incorrectly closed). It is obviously broken in http-proxy 0.10.1 and subtly broken in http-proxy 0.10.2.

Ok, thank you, this does not solve my problem, but it does occur less frequently.

I'm keeping all my work (eg, meteor) on 0.8 (and keeping http-proxy at 0.10.1) until this is fixed. There is some work being done on the 0.10.x branch to fix this, which is great.

Is there anyone who knows what the underlying issue is? Where can I track this? Both for nodejs and node-http-proxy.

@jokesterfr
Copy link

I'm also very interested about this. Where can I check the current work on the 0.10.x support?

@srossross
Copy link
Contributor Author

Is there anyone who knows what the underlying issue is?
Where can I track this?

@indexzero
Copy link
Contributor

@yawnt Is working on the updates for node@0.10.x. We are aware of this issue and are working on a solution, but the implementation around streams2 is non-trivial as node-http-proxy is one of the oldest node libraries.

@srossross
Copy link
Contributor Author

@indexzero, @yawnt, thanks for the response. One issue that I noticed is that node-http-proxy does not proxy websockets (at all) to tornado servers as of node>=v0.8

To test this - Try proxying to an IPython notebook
Use *nix OS (works on mac osx) download and install the anaconda Python Distribution http://continuum.io/downloads
Run:

ipython notebook --port=8080
node-http-proxy --target localhost:8080 --port 8081
firefox http://localhost:8081

Click create notebook to get to a page with a web-socket.

@jokesterfr
Copy link

@srossross simpler than that, the http-proxy test-case for websocket just does the trick (ie: fails with node 0.10.x) : https://github.com/nodejitsu/node-http-proxy/tree/master/test/ws

@srossross
Copy link
Contributor Author

@yawnt I noticed that you have not committed to the 10.x branch for a month. I am sorry for being persistent, but this is very important to me. I am also trying to evaluate whether I should just jump in and start finding my own solution or wait for the 10.x branch to be completed.
May I ask what your timeline is? What is blocking you from completing it? Are you waiting on improvements in stream2?

Sorry and thank you for your patience

@yawnt
Copy link
Contributor

yawnt commented Sep 9, 2013

@srossross i'm working on another repo that is going to be eventually merged into node-http-proxy

@Rush
Copy link
Contributor

Rush commented Sep 9, 2013

@yawnt: Is there a way to help? Is it your branch 10.x specifically?

@robertjpayne
Copy link

@RushPL @srossross I believe Yawnt is working on https://github.com/yawnt/caronte.git

@Rush
Copy link
Contributor

Rush commented Sep 15, 2013

Cool, so I gather node-http-proxy will move to internally use that module and in itself being simply a configuration parser, router?

@robertjpayne
Copy link

@RushPL No idea how they plan to merry them up and integrate, I simply was just pointing towards the other repository incase you wanted to have a look. I have no idea how stable or ready it may be, only testing could show.

@srossross
Copy link
Contributor Author

@RushPL Thanks, I'm looking at caronte.

@cronopio
Copy link
Contributor

cronopio commented Dec 9, 2013

Hi guys, thanks a lot to all of you for the discuss and the patience. Please check it out the caronte branch, we are so excited about your feedback using that branch, also I been working improving the examples, so check also this PR #520, the issues commented here should be resolved there.

@yawnt
Copy link
Contributor

yawnt commented Dec 18, 2013

i'm going to close this as it focuses on the old version which is replaced by caronte. feel free to open issues regarding that branch if you bump into any :)

@yawnt yawnt closed this as completed Dec 18, 2013
@risacher
Copy link

Well, it's not my project...
Personally, I would not close an issue until it is fixed in master. It is not obvious to the casual user that they should be using some specific branch, particularly a branch with a cryptic name like 'caronte'.

I spent a little time trying to switch to caronte, but since I used the ProxyTable feature which is not in caronte, it was non-trivial to switch.

@yawnt
Copy link
Contributor

yawnt commented Dec 18, 2013

@risacher caronte is the new master, the current master branch is deprecated and is just there until the migration is complete (since it's a complete refactor and not a bugfix) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants