Azure API管理中的WebSocket支持 [英] WebSocket Support in Azure API management
问题描述
我使用Azure API管理作为反向代理来公开我的服务,而我的Websocket连接无效。
wss://连接和转发UPGRADE请求并且还可以看到响应(101个切换协议)。但不知何故,APi管理层正在改变"Sec-Websocket-Key"。标题,因为在"Sec-Websocket-Accept"中存在不匹配。
值。
WebSocket连接到'wss:// mywebsite.com / signalr / connect?transport = webSockets& clientProtocol = 2.0&安培; connectionToken = VxiMZBFtXoCFgatbtQZjLGRJWtXgNXNoIw4DmsJeA%2BK%2BRSrjO3EapWNKwYS%2FIriDqhN11N3Kn3to8h2ytW01sBNJ0Xe%2BUKA2dvLDIj3%2FWAw22RSrX%2BUrP&安培; connectionData =%5B%7B%22name%22%3A%22browsersignalreventhub%22%7D%5D&安培; TID = 10'
失败:WebSocket握手期间出错:错误的'Sec-WebSocket-Accept'标头值
我想知道标头是否被挂起,如果可以,可以做些什么。
嗨Santhosh,
AFAIK,不幸的是W eb-socket 目前在Azure API Management中不受支持。已经有
用户语音。请进行投票以获得更多牵引力。
您可以考虑使用Azure功能。请点击以下链接获取更多信息。
https://github.com / Azure / azure-functions-signalrservice-extension
https://anthonychu.ca/post/cosmosdb-real-time-azure-functions-signalr-service/
I have used Azure API management as a reverse proxy to expose my services and my Websocket connection are not working.
wss:// connections and UPGRADE requests are forwarded and the response (101 switching protocols) can also be seen. but somehow APi management is changing the "Sec-Websocket-Key" header because of which there is a mismatch in "Sec-Websocket-Accept"
value.
WebSocket connection to 'wss://mywebsite.com/signalr/connect?transport=webSockets&clientProtocol=2.0&connectionToken=VxiMZBFtXoCFgatbtQZjLGRJWtXgNXNoIw4DmsJeA%2BK%2BRSrjO3EapWNKwYS%2FIriDqhN11N3Kn3to8h2ytW01sBNJ0Xe%2BUKA2dvLDIj3%2FWAw22RSrX%2BUrP&connectionData=%5B%7B%22name%22%3A%22browsersignalreventhub%22%7D%5D&tid=10'
failed: Error during WebSocket handshake: Incorrect 'Sec-WebSocket-Accept' header value
I want to know if the headers are being chnged and if so what can be done about it.
Hi Santhosh,
AFAIK, Unfortunately Web-socket are currently not supported in Azure API Management. There is already a User Voice for this. Do up-vote it to get more traction.
You can consider Azure functions for this . Follow the below links for more information.
https://github.com/Azure/azure-functions-signalrservice-extension
https://anthonychu.ca/post/cosmosdb-real-time-azure-functions-signalr-service/
这篇关于Azure API管理中的WebSocket支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!