WebSocket client hangs for invalid endpoint

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

WebSocket client hangs for invalid endpoint

coudy
I’ve been using the web socket client for a while and recently noticed that the session future doesn’t always get completed on connect(). Specifically, this happens when I accidentally use ‘<a href="ws://'" class="">ws://' instead of ‘<a href="wss://'" class="">wss://', so the upgrade fails with my server responding with a 301 (and a Location rewritten to HTTPS). My code looks as follows:

var client = new WebSocketClient();
client.start();
var request = new ClientUpgradeRequest();
var sessionFuture = client.connect(delegate, serviceUri, request);
var session = sessionFuture.get();

I’d expect `session` to be `isDone()` and throw an ExecutionException. Instead the blocking get hangs forever.

Can anyone help? I can reproduce this on 9.4.12.RC2 from Maven Central.

Cheers
Michal

_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: WebSocket client hangs for invalid endpoint

Simone Bordet-3
Hi,

On Thu, Aug 30, 2018 at 10:52 PM Michal Čudrnák <[hidden email]> wrote:

>
> I’ve been using the web socket client for a while and recently noticed that the session future doesn’t always get completed on connect(). Specifically, this happens when I accidentally use ‘ws://' instead of ‘wss://', so the upgrade fails with my server responding with a 301 (and a Location rewritten to HTTPS). My code looks as follows:
>
> var client = new WebSocketClient();
> client.start();
> var request = new ClientUpgradeRequest();
> var sessionFuture = client.connect(delegate, serviceUri, request);
>
> var session = sessionFuture.get();
>
>
> I’d expect `session` to be `isDone()` and throw an ExecutionException. Instead the blocking get hangs forever.
>
> Can anyone help? I can reproduce this on 9.4.12.RC2 from Maven Central.

Please open an issue about this.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users