We replace the bare websocket.Conn type with a new Connection type which
implements `WriteJSON`, `WriteMessage`, and `Close`. The Connection
type adds mutexes around writes since gorilla doesn't support concurrent
writes to websockets.
Signed-off-by: Honza Pokorny <honza@pokorny.ca>
The `Sub()` function retrieves the list of filters from the
`Subscripton` object itself, and therefore it's unnecessary to pass it
in. The argument is unused.
Here, we remove the function argument from the definition, and from the
single call site. We then pass the filters to the initializer.
This makes it so that filters are in fact passed to the relay on the wire.