spring-cloud-gateway
spring-cloud-gateway copied to clipboard
Gateway don't close websocket connection when client close websocket.
Please run application and run GatewayTest can reproduce this problem ,and then run GatewayTest1 can close websocket connection because GatewayTest1 doesn't access through gateway. I think this issue is urgent that blocked us. Looking forward for your reply. spring-cloud-gateway-websocket-master.zip
I also have the same problem and look forward to repairing it as soon as possible.
I can confirm. I've also sent how to reproduce this issue in #480. It also blocking us.
@xurui8691413 you sample needs some updating. First you should be using a release of Finchley and not a release candidate. Once you upgrade to Finchley.SR3 you need to correctly specify the URI in your route.
@Bean
public RouteLocator wsGateway(RouteLocatorBuilder builder) {
return builder.routes()
.route("ws", predicate -> predicate
.path("/ws").filters(f ->f.setPath("/ws2"))
.uri("ws://localhost:8080"))
.build();
}
Specifying the path in the URI no longer works, you need to use the setPath filter.
After changing that I see the problem, but unsure of the fix here. @spencergibb any ideas? Could this be a reactor problem?
Related to Websocket ping #729
@rstoyanchev we need to have a chat about this and ping.
Any solution comes out?
Not yet.
Not yet.
sorry to ask ,when will this issue can be fixed?
I have to speak with the spring team first.
any update on this issue?
any solution?
过去一年了,解决这个问题了吗? 我也遇到了
It's been a year, has this problem been solved? I also met
In my case, the problem was the angular client. Please refer following snippet.
this.ws = new SockJS('http://localhost:8080/websocket-server');
this.stompClient = Stomp.over(this.ws);
this.stompClient.disconnect();
{ ... "code": 1005, "reason": "" ... }
it seems disconnect() method terminates websocket connection abnormally which results in status code 1005. to overcome this, I used following approach.
this.ws = new WebSocket('http://localhost:8080/websocket-server');
this.stompClient = Stomp.over(this.ws);
this.stompClient.unsubscribe(); this.ws.close(1000);
Any updates on this issue?