Caddy: proxy: twin websocket connections?

Created on 17 Apr 2016  路  13Comments  路  Source: caddyserver/caddy

Companion issue: https://github.com/emersion/net-browserify/issues/7

It appears to be relevant that Caddy opens two websocket connections rather than one.

Most helpful comment

Fixed by #987

All 13 comments

It opens two? How came you by this?

well, the backend server logs two connections (see linked issue). Wireshark also shows two HTTP connections to the socket, along with lots of DUP ACKs. I hesitate to post the wireshark dump since

Haha.

I do not see any information about the backend logging two connections in the linked issue -- can you link me to it directly? I must be blind!

I was curious if this was always happening and just some backend servers are tolerant of it, so I tried it with the loop example and sure enough, wireshark sees two socket connections.

Here is a shot from wireshark only showing http and websocket frames:

image

Frames <= 27 are direct, and frames > 40 are through the proxy. Note the duplicate requests in the second group.

@mholt I realized I hadn't posted the log on the linked issue, but I think the evidence above is clearer.

Maybe this is related to my issue running a jupyter notebook server with caddy acting as a reverse proxy. Websocket connections are working when I access the server directly using SSH portforwarding ssh -L 12345:localhost:12345 host but there are sporadic issues when connecting through caddy (sometimes it works, sometimes don't). I haven't figured out the problem yet because jupyters log does not show any error, so I also have to record the traffic with wireshark.

Caddy config:

jupyter.klingt.net {
    proxy / localhost:10180 {
        proxy_header Host {host}
        proxy_header X-Real-IP {remote}
        proxy_header X-Forwarded-Proto {scheme}
        websocket
    }
}

@klingtnet yeah, most likely. Stay tuned, fix in progress.

@edrex How's it coming? Anything I can help with? Since Go 1.6.2 was released last night, we can release a new version of Caddy to great benefit. Definitely want to make sure this fix gets in there.

On the road for a conf. Looked at this for an hour yesterday, made some progress but didn't get it working. Hope to get some hack time today

Continuing on #764

Fixed by #987

Jupyter notebooks are running fine with caddy 0.9.1!
Thanks to all of you for your efforts to fix this bug!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilmacFLy picture PhilmacFLy  路  3Comments

billop picture billop  路  3Comments

ericmdantas picture ericmdantas  路  3Comments

aeroxy picture aeroxy  路  3Comments

lorddaedra picture lorddaedra  路  3Comments