signalr使用websocket报500错误,
WebSocket connection to 'ws://localhost:22862/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=Ab7SuqLggw%2BJL5kWeWcdv%2FI%2FdnRcikASgBnVNnsJu1qtIGq5tV7iXvQkDim%2FYFCJ9RNJvWTe9Zgjte2siJz2KXHX3n8ERyw48QqtkOF2awR4s%2BWIMsj8OZve%2FmJYsK1a&connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D&tid=3'
failed: Error during WebSocket handshake: Unexpected response code: 500
解决方法如下:
服务端webconfig的httpRuntime节点改为
<httpRuntime maxRequestLength="502400" targetFramework="4.5" requestValidationMode="2.0" />
本文解决SignalR使用WebSocket时出现500错误的问题,通过调整服务端webconfig中httpRuntime节点的maxRequestLength和targetFramework参数,成功解决WebSocket连接失败的错误。
624

被折叠的 条评论
为什么被折叠?



