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

No 'Access-Control-Allow-Origin' header is present on the requested resource. on 1.7.7 #240

Open
ghost opened this issue Jun 2, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 2, 2015

No description provided.

@kanion
Copy link

kanion commented Jun 4, 2015

I think I have similar problem.

When I used http:// everything worked fine. When I added SSL support I have errors.

When I am using xhr-pooling I get message about blocking content from other origin:

 Zablokowano żądanie do zasobu innego pochodzenia: zasady „Same Origin Policy” nie pozwalają wczytywać zdalnych zasobów z „https://127.0.0.1:10000/socket.io/?EIO=3&transport=polling&t=1433329575886-4”. (nieudane żądanie CORS)
 engine.io-client:socket socket error {"type":"TransportError","description":0} +151ms

and in server:

 [nioEventLoopGroup-3-1] WARN com.corundumstudio.socketio.handler.AuthorizeHandler - Blocked wrong request! url: /bad-request, ip: /127.0.0.1:18646

I have apache on wamp using https on port 443 and Netty Socket.io server running on port 10000.
When I tried change https:// to wss:// then I have the same error on server and folowing on client:

socket.io-client:manager attempting reconnect +2s                                                       socket.io.js (wiersz 1284)
socket.io-client:manager readyState closed +2ms                                                         socket.io.js (wiersz 1284)
socket.io-client:manager opening wss://localhost:10541 +3ms                                                 socket.io.js (wiersz 1284)
engine.io-client:socket creating transport "websocket" +2s                                              socket.io.js (wiersz 3524)
engine.io-client:socket setting transport websocket +8ms                                                socket.io.js (wiersz 3524)
socket.io-client:manager connect attempt will timeout after 20000 +18ms                                 socket.io.js (wiersz 1284)
engine.io-client:socket socket error {"type":"TransportError","description":{"isTrusted":true}} +73ms   socket.io.js (wiersz 3524)
socket.io-client:manager connect_error +75ms                                                            socket.io.js (wiersz 1284)
socket.io-client:manager reconnect attempt error +3ms                                                   socket.io.js (wiersz 1284)
socket.io-client:manager will wait 3000ms before reconnect attempt +3ms                                 socket.io.js (wiersz 1284)
engine.io-client:socket socket close with reason: "transport error" +19ms                               socket.io.js (wiersz 3524)

Firefox nie może nawiązać połączenia z serwerem wss://localhost:10541/socket.io/?EIO=3&transport=websocket.
instance = new WebSocket(uri);

It writes that Firefox cannot connect to server wss:// but server is logging message about bad request.

I tried change Access-Control-Allow-Origin parameter to "", ":*", "127.0.0.1", "localhost" and It didin't changed anthing. Any ideas?

@ghost
Copy link
Author

ghost commented Jun 18, 2015

Maybe change the configuration's property--'origin' to hostname can be fix

need the same host

If the host is 'www.abc.com',the origin must be 'xxx.abc.com'

@SooLiD
Copy link

SooLiD commented Jun 23, 2015

We just tried this with @kanion . It's doesn't fix our problem. @380099106 thanks for help !

Anyone other ideas ?

@1TTT9
Copy link

1TTT9 commented Jul 21, 2015

Hi, I met the same problem yesterday and fixed it mostly. from my experience, did you try to append prefix 'http://' to your hostname? sth like 'http://' + hostname. Hope it help and good luck.

@kanion
Copy link

kanion commented Jul 23, 2015

When we added http:// to hostname socket.io server dont started.

We have folowing errors:

Firefox:

Zablokowano żądanie do zasobu innego pochodzenia: zasady „Same Origin Policy” nie pozwalają wczytywać zdalnych zasobów z „https://ssijpsu.org:10541/socket.io/?EIO=3&transport=polling&t=1437643425392-5”

Podczas łączenia z serwerem ssijpsu.org:10541 wystąpił błąd. SSL otrzymał rekord przekraczający największą dozwoloną długość. (Kod błędu: ssl_error_rx_record_too_long

Chrome:

GET https://ssijpsu.org:10541/socket.io/?EIO=3&transport=polling&t=1437643539387-1 net::ERR_SSL_PROTOCOL_ERROR16.Request.create @ socket.io.js:2739Request @ socket.io.js:267316.XHR.request @ socket.io.js:261416.XHR.doPoll @ socket.io.js:264417.Polling.poll @ socket.io.js:301017.Polling.doOpen @ socket.io.js:295413.Transport.open @ socket.io.js:216412.Socket.open @ socket.io.js:1603Socket @ socket.io.js:1490Socket @ socket.io.js:14423.Manager.open.Manager.connect @ socket.io.js:273(anonymous function) @ socket.io.js:535

@ryanChina
Copy link

while your server's AuthorizationListener return false,it also will happened

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