Skip to content

Commit

Permalink
renamed proxy sybcommand to socks-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ferama committed Oct 16, 2024
1 parent 16572fc commit b6cde6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions cmd/dns_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ func init() {

var dnsProxyCmd = &cobra.Command{
Use: "dns-proxy [user@]host[:port]",
Short: "Starts a dns proxy",
Long: `Starts a local dns server that sends its request through the ssh tunnel
Short: "Starts a DNS over tcp proxy",
Long: `Starts a local DNS server that sends its request through the ssh tunnel
to the configured DNS server.
It uses dns over TCP so the remote DNS serve must support TCP.
`,
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down
10 changes: 5 additions & 5 deletions cmd/socks_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
)

func init() {
rootCmd.AddCommand(proxyCmd)
rootCmd.AddCommand(socksProxyCmd)
// sshc options
cmnflags.AddSshClientFlags(proxyCmd.Flags())
cmnflags.AddSshClientFlags(socksProxyCmd.Flags())

proxyCmd.Flags().StringP("listen-address", "l", "127.0.0.1:1080", "the socks proxy listener address")
socksProxyCmd.Flags().StringP("listen-address", "l", "127.0.0.1:1080", "the socks proxy listener address")
}

var proxyCmd = &cobra.Command{
Use: "proxy [user@]host[:port]",
var socksProxyCmd = &cobra.Command{
Use: "socks-proxy [user@]host[:port]",
Short: "Starts a SOCKS proxy",
Long: `Starts a SOCKS proxy
Expand Down
2 changes: 2 additions & 0 deletions pkg/sshc/dns_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func (p *DnsProxy) resolveDomain(conn net.Conn, msg *dns.Msg) ([]byte, error) {
return nil, fmt.Errorf("failed to pack DNS message: %v", err)
}

// dns over TCP requires the queryLength info to be written
// before the query
queryLength := make([]byte, 2)
binary.BigEndian.PutUint16(queryLength, uint16(len(query)))

Expand Down

0 comments on commit b6cde6a

Please sign in to comment.