gopherjs / websocket

websocket provides high- and low-level bindings for the browser's WebSocket API.
BSD 3-Clause "New" or "Revised" License
111 stars 25 forks source link

Make Dial return net.Conn interface, not custom struct. #16

Closed dmitshur closed 8 years ago

dmitshur commented 8 years ago


This simplifies the documentation and package slightly.

Remove WriteString method. It's a wrapper around Send method, and is not helpful in the context of a net.Conn, which deals with pure streams of bytes. To send text frames, either use a WebSocket and Send, or use type assertion to access the Send method from the returned net.Conn implementation (it embeds a WebSocket).

Resolves #11.

Apply minor style improvements, internal doc fixes.


dmitshur commented 8 years ago

Tests pass:

Tests completed in 1142 milliseconds.
11 assertions of 11 passed, 0 failed.

Also tested locally with a net.Conn-style use, worked without issues.

mjohnson9 commented 8 years ago

Will review later today.

mjohnson9 commented 8 years ago

LGTM. Merging. Sorry for the delay.