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

Websocket error #252

Closed
aravindsrivats opened this issue Nov 24, 2015 · 2 comments
Closed

Websocket error #252

aravindsrivats opened this issue Nov 24, 2015 · 2 comments

Comments

@aravindsrivats
Copy link

I'm trying to set the transport as websocket and I get the following error.

io.socket.engineio.client.EngineIOException: websocket error
    at io.socket.engineio.client.Transport.onError(Transport.java:66)
    at io.socket.engineio.client.transports.WebSocket.access$500(WebSocket.java:28)
    at io.socket.engineio.client.transports.WebSocket$1$5.run(WebSocket.java:138)
    at io.socket.thread.EventThread$2.run(EventThread.java:75)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: unexpected end of stream on Connection{localhost:8001, proxy=DIRECT hostAddress=0:0:0:0:0:0:0:1 cipherSuite=none protocol=http/1.1} (recycle count=0)
    at com.squareup.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:211)
    at com.squareup.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
    at com.squareup.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:906)
    at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:746)
    at com.squareup.okhttp.Call.getResponse(Call.java:268)
    at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:224)
    at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:195)
    at com.squareup.okhttp.Call.access$100(Call.java:34)
    at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:162)
    at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
    ... 3 more
Caused by: java.io.EOFException: \n not found: size=0 content=...
    at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:201)
    at com.squareup.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
    ... 12 more

The error looks to be caused by java.io.EOFException: \n not found: size=0 content=...

My repository: https://github.com/aravindsrivats/socket.io-java/blob/master/src/main/java/ministry/dolores/App.java

@aravindsrivats
Copy link
Author

Upgrading to socket.io 1.3.7 fixed the issue.

@ABOBAKAR-IT
Copy link

on remote server config the nginx

server

{
server_name backend.me;

   location /{ 
         #  proxy_set_header X-Real-IP $remote_addr; 
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
           proxy_set_header Host $host; 
         #  proxy_set_header X-NginX-Proxy true; 
            proxy_pass http://localhost:4000/; 
                     proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
         #  proxy_redirect http://localhost:5000/ https://$server_name/;       
   } 

}

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

2 participants