diff --git a/transport/v2raywebsocket/conn.go b/transport/v2raywebsocket/conn.go index 1faeaa36..6400b118 100644 --- a/transport/v2raywebsocket/conn.go +++ b/transport/v2raywebsocket/conn.go @@ -153,6 +153,9 @@ func (c *EarlyWebsocketConn) Write(b []byte) (n int, err error) { } c.access.Lock() defer c.access.Unlock() + if c.err != nil { + return 0, c.err + } if c.conn != nil { return c.conn.Write(b) } @@ -174,6 +177,9 @@ func (c *EarlyWebsocketConn) WriteBuffer(buffer *buf.Buffer) error { if c.conn != nil { return c.conn.WriteBuffer(buffer) } + if c.err != nil { + return c.err + } err := c.writeRequest(buffer.Bytes()) c.err = err close(c.create)