-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
io.origins() does not take an array of strings #3190
Comments
I think protocol shouldn't be included: io.origins(['localhost:3000', 'localhost:3001']);
// or
io.origins('localhost:3000'); |
Works with protocol when provided as a string, does not when provided in an array 😄 But thanks for clarification! |
I think it's implemented with an I'll add a note in the documentation. |
Previously, the protocol was not taken in account, which caused the following behaviour: ```js io.origins('https://foo.example.com:443'); // ok as a string io.origins(['https://foo.example.com:443'); // not ok as an array ``` Fixes socketio#3190
Previously, the protocol was not taken in account, which caused the following behaviour: ```js io.origins('https://foo.example.com:443'); // ok as a string io.origins(['https://foo.example.com:443'); // not ok as an array ``` Fixes socketio#3190
Previously, the protocol was not taken in account, which caused the following behaviour: ```js io.origins('https://foo.example.com:443'); // ok as a string io.origins(['https://foo.example.com:443'); // not ok as an array ``` Fixes #3190
I just ran into the same issue - an array with the protocol in the URL, eg Whilst the example in the documentation includes Looking at this commit, it seems that the docs were changed to include that example, yet it still happened to me? I was using I thought I'd report this here just in case. Was I possibly missing something? |
Previously, the protocol was not taken in account, which caused the following behaviour: ```js io.origins('https://foo.example.com:443'); // ok as a string io.origins(['https://foo.example.com:443'); // not ok as an array ``` Fixes socketio#3190
You want to:
Current behaviour
In the documentation it states, that
io.origins()
takes an array of strings/origins (see example https://socket.io/docs/server-api/#server-origins-value), when in fact it does not. It only works when providing a string instead of an array.Steps to reproduce (if the current behaviour is a bug)
Setting
and then connecting from
localhost:3000
does not work.It only works when setting
io.origins('http://localhost:3000')
Expected behaviour
Setup
The text was updated successfully, but these errors were encountered: