douan3414 2018-10-11 19:39
浏览 65

连接到在AWS Beanstalk上运行的GO Websocket服务器

I have a websocket server built with go running on AWS beanstalk. I'm running a load balancer with a SSL cert. I'm having issues connecting to it via the browser. If I try to connect to it through another go program running on my terminal everything works fine. I've updated my environment to accept TCP instead of HTTP connections on port 80.

When I try to connect from the webapp though I get this error.

WebSocket connection to 'wss://root.com/users/fcbd7f8d-2ef6-4fe2-b46c-22db9b107214/sockets/client' 
failed: Error during WebSocket handshake: Unexpected response code: 400

When I check the AWS logs I find this error.

the client is not using the websocket protocol: 
'websocket' token not found in 'Upgrade' header

UPDATE

if I run the webapp on my localhost and change the connection string from wss:// to ws:// it works. If I try the same url in the live webapp I get an ssl error.

Mixed Content: The page at 'https://root.com/captions' was loaded over HTTPS, 
but attempted to connect to the insecure WebSocket endpoint 
'ws://root.com/users/fcbd7f8d-2ef6-4fe2-b46c-22db9b107214/sockets/client'. 
This request has been blocked; this endpoint must be available over WSS.
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?