wetty icon indicating copy to clipboard operation
wetty copied to clipboard

404 on socket.io

Open IanPNewson opened this issue 2 years ago • 1 comments

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 image

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 under WSL2 in Windows 11
  • Browser Chrome
  • Version 100
  • node --version v17.9.0

IanPNewson avatar Apr 12 '22 12:04 IanPNewson

Can confirm this here too. I'm the Yunohost app maintainer and we can't upgrade the package because of this.

Salamandar avatar May 28 '22 08:05 Salamandar

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.

Warr1024 avatar Sep 11 '22 16:09 Warr1024

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.

Warr1024 avatar Sep 11 '22 18:09 Warr1024