默认配置情况下,Citrix ADC (Netscaler)不支持Websocket连接,如果使用Load Balancing配置了使用WebSocket连接的负载均衡服务器,客户端使用WebSocket连接将会失败。WebSocet建立连接时提示:Unexpected response code 404。
其实NetScaler支持 \”ws://\” for HTTP 80以及 \”wss://\” for HTTPS 443,两种连接方式,不过要配置HTTP Profile,并将HTTP Profile绑定到vServer上才会生效。
NetScaler 10.0以上的版本才支持WebSocket,而且只支持SLB配置WebSocket,不支持其它服务。
配置HTTP Profile
登录NetScaler,导航至System->Profiles->HTTP Profile,选择“add”按钮,新建一个HTTP Profile。
在HTTP Profile配置页面,只勾选“Enable WebSocket Connections”,其它保持默认。
vServer绑定 HTTP Profile
打开需要启用WebSocket功能的服务器,选择右侧“Advanced Settings”中的“+ Profiles”。
在Profile中,找到“HTTP Profile”,单击下拉菜单,选择已经配置好的WebSocket配置文件。
按以上方法,您已经成功启用了WebSocket服务,可以去测试了。
参考资料:
THE END
暂无评论内容