elisescu / tty-share

Share your linux or osx terminal over the Internet.
https://tty-share.com/
MIT License
816 stars 87 forks source link

Public tty-share session is showing 404? #38

Closed gregsadetsky closed 3 years ago

gregsadetsky commented 3 years ago

Hi,

I installed tty-share via Homebrew. Running tty-share --public shows a url:

$ tty-share --public
public session: https://on.tty-share.com/s/<...id...>/
local session: http://localhost:8000/s/local/
Press Enter to continue!

but then going to that URL shows a 404 page. Am I doing anything wrong? Thanks!

If it helps, pressing Enter shows this:

ERRO[0001] Server finished: listen tcp 127.0.0.1:8000: bind: address already in use 
tty-share finished
elisescu commented 3 years ago

Hi @gregsadetsky !

It looks like the port 8000 is already used on your machine. tty-share needs that port for a local session, which is created all the time (also when using the --public flag). For now, there's no way to disable that, but you can choose a different port, if indeed you need the 8000 for something else. Have a look at --listen flag, which you can set to something else, like: --listen localhost:8001. If the local session cannot be created, then the public one will not work either.

gregsadetsky commented 3 years ago

Thanks so much, I should have... read the actual error message haha. I thought that it was a problem with tty-share because the error message only appeared after I pressed Enter.

Maybe a suggestion would be to show the error message (i.e., the fact that the port 8000 is already used) right as tty-share is starting, and then exit immediately?

Thanks again! I just ran it and it works great.

elisescu commented 3 years ago

You're right - that part should definitely be better, and if it can't bind, it should just immediately exit with a nice error message, not even contact the proxy server for a public URL. I'll look at it one day :)