gravitee-io / issues

Gravitee.io - API Platform - Issues
65 stars 26 forks source link

[gateway] WebSocket opening handshake timed out #2818

Closed adrien-thebault closed 5 years ago

adrien-thebault commented 5 years ago

I need to access a websocket through Gravitee which, according to recent patch notes, should work but I can't make it work.

With version 1.28.4 I faced an exception so I upgraded to 1.29.5 (and then to nightly) where it still does not work but doesn't give an error either, the handshake between my front application and the gateway times out.

I tried with a ws:// endpoint, a http:// endpoint, I tried multiple versions of Gravitee, I enabled websockets in gravitee.yml but still, while Gravitee's web UI reports that it's working correctly image Google Chrome does not agree image And I'm not receiving any data from the websocket

Expected Behavior

My application should be able to connect to a websocket through Gravitee.

Current Behavior

Handshake between my application and gravitee times out.

Steps to Reproduce (for bugs)

  1. Have a websocket (mine is a Springboot Websocket)
  2. Expose it through Gravitee
  3. Try to connect using any websocket client (I tried with StompJS and with a Google Chrome extension called WebSocket Test Client)
  4. Wait for the handshake timeout

TEST-WS-1-0.txt

Your Environment

brasseld commented 5 years ago

Hey @adrien-thebault

May I ask you to share a sample spring boot based sample ? I will give a try.

Also, can you confirm that you're not consuming a wss endpoint.

Cheers,

jaimesf commented 5 years ago

Same error as #2812

brasseld commented 5 years ago

@jaimesf Not sure you're able to, but did you have a try with the fix provided for https://github.com/gravitee-io/issues/issues/2811 ?

adrien-thebault commented 5 years ago

Hey @adrien-thebault

May I ask you to share a sample spring boot based sample ? I will give a try.

Also, can you confirm that you're not consuming a wss endpoint.

Cheers,

I can confirm it is not a wss endpoint. I'll provide a springboot sample, meanwhile you can try with the sample TEST-WS-1-0.txt provided which will use ws://demos.kaazing.com/echo as the endpoint.

jaimesf commented 5 years ago

@jaimesf Not sure you're able to, but did you have a try with the fix provided for #2811 ?

Is this fix included in last version released 1.29.5? I'll test it when available.

brasseld commented 5 years ago

It will be available as part of the next 1.29.5, right.

adrien-thebault commented 5 years ago

https://github.com/adrien-thebault/sample-springboot-ws Here you can find a quick (and mostly dirty) sample of a Springboot websocket and two NodeJS clients (one is consuming the websocket directly, the other through gravitee).

brasseld commented 5 years ago

@adrien-thebault

I had a try and it works well, so I'm pretty sure websocket support is not enabled for the gateway:

Please check https://github.com/gravitee-io/gravitee-gateway/blob/master/gravitee-gateway-standalone/gravitee-gateway-standalone-distribution/src/main/resources/config/gravitee.yml#L35

jaimesf commented 5 years ago

Can we override websocket config on docker, with environment vars? gravitee_http_websocket_enabled=true That's correct? I tried this way, and doesnt worked...

brasseld commented 5 years ago

I just had a try and sounds ok for me....

adrien-thebault commented 5 years ago

@adrien-thebault

I had a try and it works well, so I'm pretty sure websocket support is not enabled for the gateway:

Please check https://github.com/gravitee-io/gravitee-gateway/blob/master/gravitee-gateway-standalone/gravitee-gateway-standalone-distribution/src/main/resources/config/gravitee.yml#L35

So I tried from a fresh install and now everything works, looks like it was indeed on my end. Sorry!

brasseld commented 5 years ago

No worries !

Thanks a lot for your feedback!