-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
is it possible to add Access-Control-Allow-Origin: * to the reply header ? #334
Comments
That would be the job of the page you're running the js on, not the websocket server. What are you using to serve it? |
Right now I was just running it from the file (URL would be file:https:///my/wstest/index.html). I was also testing with running a simple HTTP server that is serving the index.html (was using |
I think everything is blocked by default when running from the local filesystem (with file:https://). If it doesn't work with the python server and |
It's Firefox 39.0.3 on Linux. I am logging what arrives on the websocket Java server that I am running:
|
It's the server's response headers that matters for CORS control. What's the output of |
gives
|
Really weird, I have no idea what could do that. |
But - isn't it like this: the JS code, read from http:https://localhost:6666/ is run in the browser and ordered to create websocket to address http:https://localhost:8887 (that's where my websocket service is running). The browser issues |
The browser shouldn't even try to contact the websocket server. Which is why I find this really weird.
|
I am using Socket.IO to create clients and I can't call Browser should not contact the websocket server? but - it is running the JS code that tell it just that?... |
|
bump |
I'm running a Java-WebSocket server on Android. I managed to add Still no luck though. I get this when sending a message from server to client:
|
@lwiechec did you ever solve the problem you were having? |
Hi, no I haven't. But I have switched to using web socket implementations from Tomcat, as the application that I planned to write had to be deployed as WAR... ---- On Ter, 26 Abr 2016 23:50:08 +0200 Paul M. Christian <[email protected]>wrote ---- @lwiechec did you ever solve the problem you were having? — You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub |
Closing this issue for #490 Greetings |
I am running a websocket service (I have created a simple one, that extends
WebSocketServer
) on my own machine onhttp:https://localhost:8887
and trying to access it using Socket.IO using this piece of client code:However, the browser is reporting that Cross-Origin Request is blocked:
I think adding HTTP header to the reply that includes
Access-Control-Allow-Origin: *
header would help in overcoming the cross-domain limitation?I was looking for an good place to add it; without modification to the code, I would have to implement another draft class.
What do you think?
The text was updated successfully, but these errors were encountered: