<p>Hi all,<br/>
I wanted to ask, have someone experience with Websocket in Golang. I know that Gorilla provide Websocket library but is Golang suitable for Websocket based application or Server Sent Event?<br/>
When using Websocket with Golang, it could appear problem with GC, i have read somewhere.</p>
<hr/>**评论:**<br/><br/>albatr0s: <pre><p>Yes, it's suitable.</p></pre>james-h: <pre><p>I have used the <code>golang.org/x/net/websocket</code> package and I haven't had any problems with it. I don't see how the garbage collector could be an issue.</p></pre>avrtno: <pre><p>Have you run into <a href="https://github.com/golang/go/issues/7632" rel="nofollow">the fragmentation issue</a>? </p></pre>james-h: <pre><p>Ah, I wasn't aware of this. In my case, I was only sending short messages. That being said, if you're using web sockets to communicate with a web browser, it's inevitable since web browsers only read a single frame at a time.</p></pre>robvdl: <pre><p>I thought that the built-in websocket support was based an older version of the websocket protocol, I forget exactly what the issue was, but it is pretty much why you should use Gorilla websockets... well last time I checked anyway.</p></pre>xsolarwindx: <pre><p>What kind of question is this...</p></pre>simon-whitehead: <pre><p>There's also <em>cough</em> nice libraries (<a href="https://github.com/simon-whitehead/relayr" rel="nofollow">https://github.com/simon-whitehead/relayr</a>) <em>cough</em> to make that a bit easier.</p>
<p>(I wrote that one - works nicely for me)</p></pre>PsyWolf: <pre><p>server sent events in golang: <a href="http://sse.getgin.io/room/hn" rel="nofollow">http://sse.getgin.io/room/hn</a></p></pre>ksawicki: <pre><p>I'm using wampv2 implementation. <a href="https://github.com/jcelliott/turnpike/tree/v2?files=1" rel="nofollow">https://github.com/jcelliott/turnpike/tree/v2?files=1</a></p></pre>