Open mortont opened 9 months ago
Please add trace => true
to the map given to open_unix so we can see what's going on.
I've attached the trace, I don't see anything obvious at first glance: trace.txt
Right the problem is with the host
header, since you are using a Unix socket you will need to provide the host
header for every request you make as Gun is not able to figure it out and sends garbage.
Gun should not send garbage so this ticket should remain open, and I believe users of unix sockets will be required to provide the host themselves as we cannot guess it in this scenario so the documentation should be updated to reflect that.
Thanks for the trace!
Thanks! That fixed it for me. For anyone coming here with the same issue, this was my change:
streamref = :gun.ws_upgrade(pid, '/ws', [{<<"host">>, <<"localhost">>}])
When upgrading a unix socket connection to a websocket connection using this snippet I get a failure
ws_upgrade_failed
response. I'm able to connect to this service and perform a websocket upgrade using other clients in other languages, so I don't think it is an issue with the server implementationresults
This is successful if I use a standard
:gun.open
connection over TCP/IP, is there something I'm missing for the unix socket case?