Skip to content

Commit

Permalink
Merge pull request #1006 from xmapst/master
Browse files Browse the repository at this point in the history
实现HTTP/SOCKS5混合端口
  • Loading branch information
tobyxdd authored Apr 13, 2024
2 parents d9346f6 + a656a20 commit 6e00aa3
Show file tree
Hide file tree
Showing 8 changed files with 1,283 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/apernet/hysteria/app/internal/forwarding"
"github.com/apernet/hysteria/app/internal/http"
"github.com/apernet/hysteria/app/internal/proxymux"
"github.com/apernet/hysteria/app/internal/redirect"
"github.com/apernet/hysteria/app/internal/socks5"
"github.com/apernet/hysteria/app/internal/tproxy"
Expand Down Expand Up @@ -531,7 +532,7 @@ func clientSOCKS5(config socks5Config, c client.Client) error {
if config.Listen == "" {
return configError{Field: "listen", Err: errors.New("listen address is empty")}
}
l, err := correctnet.Listen("tcp", config.Listen)
l, err := proxymux.ListenSOCKS(config.Listen)
if err != nil {
return configError{Field: "listen", Err: err}
}
Expand All @@ -556,7 +557,7 @@ func clientHTTP(config httpConfig, c client.Client) error {
if config.Listen == "" {
return configError{Field: "listen", Err: errors.New("listen address is empty")}
}
l, err := correctnet.Listen("tcp", config.Listen)
l, err := proxymux.ListenHTTP(config.Listen)
if err != nil {
return configError{Field: "listen", Err: err}
}
Expand Down
12 changes: 12 additions & 0 deletions app/internal/proxymux/.mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
with-expecter: true
dir: internal/mocks
outpkg: mocks
packages:
net:
interfaces:
Listener:
config:
mockname: MockListener
Conn:
config:
mockname: MockConn
Loading

0 comments on commit 6e00aa3

Please sign in to comment.