dongrong5189 2016-12-27 09:05
浏览 64

docker容器上的Golang Websocket服务器不会向外界发送消息

I have a golang backend, node frontend. And it worked both on windows and ubuntu without docker. Now I am trying to dockerize everything. I put both backend and frontend in the same docker container. I can establish initial connection but later the backend kept throwing error like this: Error message printed by golang

I have exposed port 8000 to 8004, the ws port is 8000 and frontend port is 8004. I have tried both --net=host as well as exposing everything as host ip address 192.168.1.4. Non of them worked.

On the browser side, the websocket client always get 101 response like this: Screenshot from chrome

I think it could be a config problem on docker. But I have no lead right now on how to deal with this. The browser tested is Chrome 55 on windows 10. Docker, golang and node are of the latest. The host machine is on Ubuntu 16.10 as well as container os.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计