mirror of
https://github.com/Snawoot/windscribe-proxy.git
synced 2026-04-03 23:48:15 +00:00
Compare commits
1 Commits
v1.5.0
...
proxy_sni_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2569c5e584 |
2
main.go
2
main.go
@@ -251,7 +251,7 @@ func run() int {
|
||||
}
|
||||
|
||||
proxyNetAddr := net.JoinHostPort(proxyHostname, strconv.FormatUint(uint64(ASSUMED_PROXY_PORT), 10))
|
||||
handlerDialer := NewProxyDialer(proxyNetAddr, proxyHostname, auth, caPool, dialer)
|
||||
handlerDialer := NewProxyDialer(proxyNetAddr, "a", auth, caPool, dialer)
|
||||
mainLogger.Info("Endpoint: %s", proxyNetAddr)
|
||||
mainLogger.Info("Starting proxy server...")
|
||||
handler := NewProxyHandler(handlerDialer, proxyLogger)
|
||||
|
||||
10
upstream.go
10
upstream.go
@@ -91,7 +91,7 @@ func (d *ProxyDialer) DialContext(ctx context.Context, network, address string)
|
||||
|
||||
conn, err := d.next.DialContext(ctx, "tcp", d.address)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("proxy dial failed: %w", err)
|
||||
}
|
||||
|
||||
if d.tlsServerName != "" {
|
||||
@@ -134,21 +134,21 @@ func (d *ProxyDialer) DialContext(ctx context.Context, network, address string)
|
||||
|
||||
rawreq, err := httputil.DumpRequest(req, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("unable to prepare request for proxy: %w", err)
|
||||
}
|
||||
|
||||
_, err = conn.Write(rawreq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("unable to send request to proxy: %w", err)
|
||||
}
|
||||
|
||||
proxyResp, err := readResponse(conn, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("unable to read proxy response: %w", err)
|
||||
}
|
||||
|
||||
if proxyResp.StatusCode != http.StatusOK {
|
||||
return nil, errors.New(fmt.Sprintf("bad response from upstream proxy server: %s", proxyResp.Status))
|
||||
return nil, fmt.Errorf("bad response from upstream proxy server: %s", proxyResp.Status)
|
||||
}
|
||||
|
||||
return conn, nil
|
||||
|
||||
Reference in New Issue
Block a user