mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-15 19:31:06 +01:00
19 lines
299 B
Go
19 lines
299 B
Go
package ws
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
|
|
"github.com/gorilla/websocket"
|
|
)
|
|
|
|
func Dial(address string) (net.Conn, error) {
|
|
addr := fmt.Sprintf("ws://" + address)
|
|
wsConn, _, err := websocket.DefaultDialer.Dial(addr, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
conn := NewConn(wsConn)
|
|
return conn, nil
|
|
}
|