Skip to content

Commit

Permalink
try to fix ws in https
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhaoxx committed Mar 28, 2024
1 parent 373f0b7 commit 04c65e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions http/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (hpx *httpproxy) Insert(index int, id string, hosts []string, backend strin
Backend: backend,
}

var tlsc = tls.Config{NextProtos: []string{"http/1.1"}}
var tlsc = tls.Config{}
var tpa = &http.Transport{
TLSClientConfig: &tlsc,
DialContext: (&net.Dialer{
Expand Down Expand Up @@ -181,8 +181,10 @@ func (hpx *httpproxy) Insert(index int, id string, hosts []string, backend strin
}
return u_ws
}}
var tlsc_ws = tls.Config{}
tlsc_ws.InsecureSkipVerify = InsecureSkipVerify

buf.WSProxy.Dialer = &websocket.Dialer{TLSClientConfig: &tlsc, NetDial: func(network, addr string) (net.Conn, error) {
buf.WSProxy.Dialer = &websocket.Dialer{TLSClientConfig: &tlsc_ws, NetDial: func(network, addr string) (net.Conn, error) {
netDialer := &net.Dialer{}
return netDialer.Dial(network, hostport)
}}
Expand Down

0 comments on commit 04c65e8

Please sign in to comment.