Skip to content

Commit

Permalink
random tunnel path for ws/wss connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Musixal committed Nov 28, 2024
1 parent 75046d4 commit 137d699
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions internal/server/transport/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func (s *WsTransport) tunnelListener() {
go s.Restart()
return
}

s.controlChannel = conn

s.logger.Info("control channel established successfully")
Expand All @@ -260,7 +259,7 @@ func (s *WsTransport) tunnelListener() {

s.config.TunnelStatus = fmt.Sprintf("Connected (%s)", s.config.Mode)

} else if r.URL.Path == "/tunnel" {
} else if strings.HasPrefix(r.URL.Path, "/tunnel") {
wsConn := TunnelChannel{
conn: conn,
ping: make(chan struct{}),
Expand Down
2 changes: 1 addition & 1 deletion internal/server/transport/wsmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (s *WsMuxTransport) tunnelListener() {

s.config.TunnelStatus = fmt.Sprintf("Connected (%s)", s.config.Mode)

} else if r.URL.Path == "/tunnel" {
} else if strings.HasPrefix(r.URL.Path, "/tunnel") {
session, err := smux.Client(conn.NetConn(), s.smuxConfig)
if err != nil {
s.logger.Errorf("failed to create MUX session for connection %s: %v", conn.RemoteAddr().String(), err)
Expand Down

0 comments on commit 137d699

Please sign in to comment.