diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index d90e01b..584ee2e 100644 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -35,7 +35,7 @@ func NewClient(tunnel string, password string) (Client, error) { case "http2", "h2": return h2.NewClient(tunnel, password) case "ws", "wss": - return websocket.NewClient(tunnel) + return websocket.NewClient(tunnel, password) } return nil, fmt.Errorf("not supported schema: %s", URL.Scheme) @@ -51,9 +51,9 @@ func NewServer(tunnel string, password string) (Server, error) { case "grpc", "grpcs": return grpc.NewServer(tunnel, password) case "http2", "h2": - return h2.NewServer(tunnel) + return h2.NewServer(tunnel, password) case "ws", "wss": - return websocket.NewServer(tunnel) + return websocket.NewServer(tunnel, password) } return nil, fmt.Errorf("not supported schema: %s", URL.Scheme) } diff --git a/tunnel/websocket/client.go b/tunnel/websocket/client.go index 1c998c6..ba3f78c 100644 --- a/tunnel/websocket/client.go +++ b/tunnel/websocket/client.go @@ -14,7 +14,7 @@ type Client struct { origin string } -func NewClient(tunnel string) (*Client, error) { +func NewClient(tunnel string, password string) (*Client, error) { URL, err := url.Parse(tunnel) if err != nil { return nil, err diff --git a/tunnel/websocket/server.go b/tunnel/websocket/server.go index 9ffd505..acd602a 100644 --- a/tunnel/websocket/server.go +++ b/tunnel/websocket/server.go @@ -14,7 +14,7 @@ type Server struct { handler func(io.ReadWriter) } -func NewServer(tunnel string) (*Server, error) { +func NewServer(tunnel string, password string) (*Server, error) { return &Server{ tunnel: tunnel, }, nil