Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
isayme committed May 10, 2024
1 parent 8c0ab3c commit e0e6e2a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
}
2 changes: 1 addition & 1 deletion tunnel/websocket/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tunnel/websocket/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e0e6e2a

Please sign in to comment.