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

Cross origin configuration support #240

Closed
billchurch opened this issue May 11, 2021 · 1 comment
Closed

Cross origin configuration support #240

billchurch opened this issue May 11, 2021 · 1 comment

Comments

@billchurch
Copy link
Owner

Versions < 0.3.0 do not have support for setting the COORS parameters for Socket.IO.

By default, Socket.io 2.2.x allows all hosts/ports as origin *:*.

@billchurch
Copy link
Owner Author

billchurch commented May 11, 2021

New config.json parameter http.origins takes a JSON object of authorized origins.

Defaults is localhost:2222

See https://socket.io/docs/v2/handling-cors/ for more details on how to use this.

If having trouble, consider enabling debug from an interactive shell for this app (will require full npm install and not production)

DEBUG=socket.io:server npm run start

Any origin errors will show up in a log statement like below:

socket.io:server origin http://localhost:2222/ssh/host/192.168.0.1 is not valid +2s

image

hktalent pushed a commit to hktalent/webssh2 that referenced this issue Jun 3, 2022
Support setting origins for socket.io, fixes billchurch#240
hktalent pushed a commit to hktalent/webssh2 that referenced this issue Jun 3, 2022
Support setting origins for socket.io, fixes billchurch#240
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

1 participant