Skip to content

Commit

Permalink
fix android worker issue
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Aug 6, 2023
1 parent 03046ec commit 58e825d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bepass-cli/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (s *Server) sendSplitChunks(dst io.Writer, chunks map[int][]byte, config Ch
func (s *Server) Handle(ctx context.Context, w io.Writer, req *socks5.Request) error {
if s.WorkerConfig.WorkerEnabled &&
!s.WorkerConfig.WorkerDNSOnly &&
!strings.Contains(s.WorkerConfig.WorkerAddress, req.DstAddr.FQDN) {
(!strings.Contains(s.WorkerConfig.WorkerAddress, req.DstAddr.FQDN) || strings.TrimSpace(req.DstAddr.FQDN) == "") {
if err := socks5.SendReply(w, statute.RepSuccess, nil); err != nil {
s.Logger.Errorf("failed to send reply: %v", err)
return err
Expand Down
2 changes: 1 addition & 1 deletion bepass-cli/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TunnelToWorkerThroughWs(ctx context.Context, w io.Writer, req *socks5.Reque
if err != nil {
return err
}
endpoint := fmt.Sprintf("wss://%s/connect?host=%s&port=%d", u.Host, req.RawDestAddr.FQDN, req.RawDestAddr.Port)
endpoint := fmt.Sprintf("wss://%s/connect?host=%s&port=%s", u.Host, strings.Split(req.DstAddr.String(), ":")[0], strings.Split(req.DstAddr.String(), ":")[1])
wsConn, err := wsDialer(endpoint, socks5BindAddress)
if err != nil {
if err := socks5.SendReply(w, statute.RepServerFailure, nil); err != nil {
Expand Down

0 comments on commit 58e825d

Please sign in to comment.