Skip to content

feat(cli): add reverse tunnelling SSH support for unix sockets #9976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
monika-canva committed Sep 29, 2023
commit add7b4584e2664171d8ec78c516f136cd82503a0
12 changes: 4 additions & 8 deletions cli/remoteforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ type cookieAddr struct {
var remoteForwardRegexTCP = regexp.MustCompile(`^(\d+):(.+):(\d+)$`)

// remote_socket_path:local_socket_path (both absolute paths)
var remoteForwardRegexUnixSocket = regexp.MustCompile(`^(\\.+):(\\.+)$`)
var remoteForwardRegexUnixSocket = regexp.MustCompile(`^(\/.+):(\/.+)$`)

func remoteForwardTCP(flag string) bool {
reg := remoteForwardRegexTCP.MatchString(flag)
fmt.Println("remoteForwardTCP", reg)
return reg
return remoteForwardRegexTCP.MatchString(flag)
}

func remoteForwardUnixSocket(flag string) bool {
reg := remoteForwardRegexUnixSocket.MatchString(flag)
fmt.Println("remoteForwardUnixSocket", reg)
return reg
return remoteForwardRegexUnixSocket.MatchString(flag)
}

func validateRemoteForward(flag string) bool {
return remoteForwardUnixSocket(flag) || remoteForwardTCP(flag)
return remoteForwardTCP(flag) || remoteForwardUnixSocket(flag)
}

func parseRemoteForwardTCP(matches []string) (net.Addr, net.Addr, error) {
Expand Down