client.go 243 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, false), nil
  9. }