client.go 236 B

1234567891011
  1. package rest_websocket
  2. import "github.com/gorilla/websocket"
  3. func NewClient(addr string) (*Socket, error) {
  4. conn, _, err := websocket.DefaultDialer.Dial(addr, nil)
  5. if err != nil {
  6. return nil, err
  7. }
  8. return NewSocket(conn), nil
  9. }