wetty
wetty copied to clipboard
404 on socket.io
Hi, I have installed wetty in Ubuntu 20.04 under WSL2 in Windows 11. It is not working due to a 404 error attempting to GET http://localhost:3000/wetty/ssh/ian/socket.io?EIO=4&transport=polling&t=O0TpkTf
Screenshots
Desktop (please complete the following information):
- OS: Ubuntu 20.04 under WSL2 in Windows 11
- Browser Chrome
- Version 100
- node --version v17.9.0
Can confirm this here too. I'm the Yunohost app maintainer and we can't upgrade the package because of this.
Same.
I've been working around this by rewriting /wetty/ssh/.*/socket.io(.*)
to /wetty/socket.io$1
at the reverse proxy layer. Of course it would be very nice if this were actually fixed so the hack was no longer necessary.
It looks like the fundamental issue is that the client is hosted at potentially multiple locations, e.g. basepath
and basepath/ssh/:user
, and any relative paths to resources will be starting at either one of those places. Using absolute paths might help, but would create problems for reverse proxy setups (e.g. see #407).
The simplest solution might be to just replace the basepath/ssh/:user
route with a basepath?u=user
querystring parameter instead, since query parameters are not included in relative URL calculation by the browser. If there is only ever one "path" component of the URL across all "modes" of access, then all resources will reliably exist at the expected relative paths.
The one drawback to this is that it needs a migration/deprecation plan for anyone who is already using basepath/ssh/:user paths to switch to basepath?u=user style URLs without unnecessary pain.