Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth in websocat ws-l #192

Open
tarasglek opened this issue Jul 30, 2023 · 2 comments
Open

auth in websocat ws-l #192

tarasglek opened this issue Jul 30, 2023 · 2 comments

Comments

@tarasglek
Copy link

I would like to be able to do

websocat --exit-on-eof --basic-auth `echo -n 'username:password' | base64` ws-l:0.0.0.0:8810 sh-c:'bash --rcfile emptyrc -i  2>&1' --binary 

To offer a websocket JS-in-webpage-accessible shell server with auth. However at the moment, when i run the command like this it still accepts unauthenticated clients

@tarasglek
Copy link
Author

Alternatively it would be helpful to be able to specify /secret-prefix like ws-l:0.0.0.0:8810/secret-prefix

@vi
Copy link
Owner

vi commented Sep 17, 2023

If you want to enforce specific prefix, you may want --restrict-uri option:

        --restrict-uri <restrict_uri>
            When serving a websocket, only accept the given URI, like `/ws`
            This liberates other URIs for things like serving static files or proxying.

It does not mean the shell server would be secure.

You may want to handle auth upstream (i.e. on Nginx / Caddy). If you want shell access from browser, you may also find ttyd useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants