douxu3315 2015-11-26 00:39
浏览 764

Golang WebSocket客户端

I want to make client websocket connections to exertnal server each connection = goroutine and reader. I was looking informations on the internet but I found how to create server websocket tutorials. Can anyone be so kind and make a trivial example and walk me through. I am using standart golang libary https://golang.org/x/net/websocket.

I created some code but when I closed one connection program exited with EOF information. I won't post the code because it's probably bad duo to the fact it was my first try.

I know how to read/send message from websocket but I don't know how to create multiple connections.

Any informations, examples would be appreciate, thanks for reading

  • 写回答

2条回答 默认 最新

  • dongmubei7950 2015-11-26 03:31
    关注

    You can use the Gorilla WebSocket library

    Here's an example of it's use as a client

    评论

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示