lxzan / gws

simple, fast, reliable websocket server & client, supports running over tcp/kcp/unix domain socket. keywords: ws, proxy, chat, go, golang...
https://pkg.go.dev/github.com/lxzan/gws
Apache License 2.0
1.36k stars 87 forks source link

add server #5

Closed fzdwx closed 1 year ago

fzdwx commented 1 year ago

你运行一下我这个,启动 server 然后在启动 client。

image

会抛异常

lxzan commented 1 year ago

我知道panic原因了, 是因为WriteString用了你上次PR提供的unsafe

fzdwx commented 1 year ago

..

fzdwx commented 1 year ago

server 端咋可以在 open 里面写

lxzan commented 1 year ago

服务端Write不会计算异或

fzdwx commented 1 year ago

image

确实能直接发送了

lxzan commented 1 year ago

WriteString直接改成[]byte转换吧, 这个方法一般只会在debug的时候用, 不值得花太多心思优化

fzdwx commented 1 year ago

ok