Is anyone using websockets with golang?

polaris · · 659 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Do you use it in production and what are your experiences?</p> <hr/>**评论:**<br/><br/>lstokeworth: <pre><p>We use Gorilla and have been happy with it. It would be nice if Gorilla supported compression, but otherwise no complaints. </p></pre>natefinch: <pre><p>We use RPC over websockets for juju (github.com/juju/juju). Both for inter server communication and for client-server communication. We have both a go client and a web client. Works great, no problems. </p></pre>lifter: <pre><p>We&#39;ve used Gorilla quite a bit and have been pretty happy with it too. Is there anything in particular you&#39;re curious about?</p></pre>abeiz: <pre><p>Was just wondering if anyone had issues with it at all, gorilla ws seems pretty stable though. I will probably run a websocket server with around 10k simultaneous connections. Tried this with PHP and it was a disaster :( node might work out but I love golang.</p></pre>bmurphy1976: <pre><p>Using Gorilla heavily. I find the API a bit unwieldy, but we made it work. The hardest part with it is getting a clean shutdown when you are done with a socket. We never quite got that right and just log connection closed errors and move on. Obviously we have to be resilient in the face of failure, but we wanted to keep our logs relatively quiet as well. Whatever, it works.</p></pre>lstokeworth: <pre><p>A server application can simply call the Close method when done with the connection or on any error. Use <a href="https://godoc.org/github.com/gorilla/websocket#IsUnexpectedCloseError" rel="nofollow">https://godoc.org/github.com/gorilla/websocket#IsUnexpectedCloseError</a> to log cleanly. Our application expects normal and going away errors, so we log only when <code>IsUnexpectedCloseError(e, websocket.CloseNormalClosure, websocket.CloseGoingAway)</code> returns true. We don&#39;t log network errors.</p></pre>m4ng0squ4sh: <pre><p>Please have a look at <a href="https://github.com/desertbit/glue" rel="nofollow">https://github.com/desertbit/glue</a></p></pre>anacrolix: <pre><p>I use the standard golang implementation. No problems, except for Cloudflare sucking, but that&#39;s not Go&#39;s fault</p></pre>Chohmoh: <pre><p>We had an article about <a href="https://www.reddit.com/r/golang/comments/49ckxd/practical_golang_using_websockets/" rel="nofollow">websockets</a> last week. Maybe you find this helpful.</p></pre>abeiz: <pre><blockquote> <p>websockets</p> </blockquote> <p>Nice article, thanks for linking that.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

659 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传