WebSocket Error during WebSocket handshake: Unexpected response code: 200

首先明确,出现200说明服务器的webSocketServer已经收到了请求

	public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandlerwsHandler,Map<String, Object> attributes) throws Exception {
		System.out.println("连接前");
		return false;
	}

我的问题出在 beforeHandshake 方法return了false,改为ture则可,因为内代码是生成的,新手应该很容易踩到这个坑

发布了4 篇原创文章 · 获赞 0 · 访问量 72

猜你喜欢

转载自blog.csdn.net/iamadelian/article/details/104404958