0

So my websocket is opening properly to faye, I'm using the nginx_tcp_proxy module. When I run a curl it looks good:

$ curl http://now.2u.fm:9200/faye\?message\=%5B%7B%22channel%22%3A%22%2Fmeta%2Fhandshake%22%2C%22version%22%3A%221.0%22%2C%22supportedConnectionTypes%22%3A%5B%22callback-polling%22%5D%2C%22id%22%3A%221%22%7D%5D\&jsonp\=__jsonp6__
__jsonp6__([{"id":"1","channel":"/meta/handshake","successful":true,"version":"1.0","supportedConnectionTypes":["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],"clientId":"jls0srprht51xb368yrojft3h4drgu0","advice":{"reconnect":"retry","interval":0,"timeout":45000}}]);#

And curl with the -I flag

HTTP/1.1 200 OK
...
Connection: close

But I'm getting failed GET requests when my website tries to hit this as GET (no error code):

enter image description here

edit: I noticed it says "switching protocols" just now!

enter image description here

Same as when I try and hit the url directly in my browser.

My gut says, "hey, thats because you have a tcp connection open not an http one!", but then is private_pub using GET? But for all I know a GET request is just fine over TCP and I'm doing something wrong.

Nathan Wienert
  • 1,623
  • 3
  • 19
  • 25

1 Answers1

0

I found out the issue was that Faye needs to be able to open a socket and use http. Because private_pub assumes you do both on the same domain/port this was impossible using the tcp module without having to modify private_pub and the faye extension it was loading to use the right ports.

In the end I used HAProxy instead as it was much simpler to set up and required no modification of private pub.

Nathan Wienert
  • 1,623
  • 3
  • 19
  • 25