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

Server Not Connected #13

Open
Vijay-Thalapathy opened this issue Mar 3, 2021 · 1 comment
Open

Server Not Connected #13

Vijay-Thalapathy opened this issue Mar 3, 2021 · 1 comment

Comments

@Vijay-Thalapathy
Copy link

E/TAG: Error
java.lang.Exception: java.net.ProtocolException: Expected HTTP 101 response but was '401 '
at ua.naiksoftware.stomp.OkHttpConnectionProvider$1.onFailure(OkHttpConnectionProvider.java:83)
at okhttp3.internal.ws.RealWebSocket.failWebSocket(RealWebSocket.kt:592)
at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:174)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.net.ProtocolException: Expected HTTP 101 response but was '401 '
at okhttp3.internal.ws.RealWebSocket.checkUpgradeSuccess$okhttp(RealWebSocket.kt:224)
at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:170)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 

Can you specify how to add authentication header in your library for connecting the websocket URL So
I'm currently facing this issue from your library kindly check out this issue get back to me as soon as possible.

@UPocek
Copy link

UPocek commented Jan 7, 2023

This is because of the error in the documentation you need to define your endpoint like this ws://YOUR_IP:PORT/socket-example/websocket

2 key things here:

  • you need ws://
  • you need /websocket at the end

Check out this link for more information.

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