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

Pass URI to socket.io-client to specify namespace #1543

Closed
wants to merge 1 commit into from

Conversation

jimklo
Copy link

@jimklo jimklo commented May 7, 2021

The example app-namespace.py which uses templates/index.html
did not correctly initialize the socket.io-client with the /test
namespace. This prevented the client from communicating with
the example application.

This modification, constructs the URI based upon the current
window.location, and apppends /test so the client subscribes
to the correct namespace.

The example `app-namespace.py` which uses `templates/index.html`
did not correctly initialize the socket.io-client with the `/test`
namespace.  This prevented the client from communicating with
the example application.

This modification, constructs the URI based upon the current
`window.location`, and apppends `/test` so the client subscribes
to the correct namespace.
@miguelgrinberg
Copy link
Owner

This was a mistake on my part. At some point I simplified the app.py example to use the default namespace, and forgot that both app.py and app_namespace.py share the same index.html. The correct fix here is not in the html file, we want app_namespace.py to use the / namespace instead of /test, and that way both examples will work.

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

Successfully merging this pull request may close these issues.

None yet

2 participants