mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-02 03:17:35 +03:00
Fix tailscale dialer
This commit is contained in:
parent
f70ca3d190
commit
68df19ae13
1 changed files with 14 additions and 0 deletions
|
@ -2,8 +2,10 @@ package tailscale
|
|||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"net/url"
|
||||
"os"
|
||||
|
@ -212,6 +214,18 @@ func (t *Endpoint) Start(stage adapter.StartStage) error {
|
|||
t.stack = ipStack
|
||||
|
||||
localBackend := t.server.ExportLocalBackend()
|
||||
localBackend.SetHTTPTestClient(&http.Client{
|
||||
Transport: &http.Transport{
|
||||
ForceAttemptHTTP2: true,
|
||||
DialContext: func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return t.server.Dialer.DialContext(ctx, network, M.ParseSocksaddr(address))
|
||||
},
|
||||
TLSClientConfig: &tls.Config{
|
||||
RootCAs: adapter.RootPoolFromContext(t.ctx),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
perfs := &ipn.MaskedPrefs{
|
||||
ExitNodeIPSet: true,
|
||||
AdvertiseRoutesSet: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue