File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "github.com/urnetwork/server/session"
2828 // "github.com/urnetwork/server/ulid"
2929 // "github.com/urnetwork/server/jwt"
30+ "github.com/urnetwork/connect"
3031)
3132
3233const NetworkClientHandlerHeartbeatTimeout = 60 * time .Second
@@ -266,6 +267,10 @@ func AuthNetworkClient(
266267 )
267268 }
268269
270+ if proxyDeviceState .Location != nil {
271+ proxyDeviceState .DnsResolverSettings = connect .RegionalDnsResolverSettings (proxyDeviceState .Location .CountryCode )
272+ }
273+
269274 proxyDeviceConfig := & ProxyDeviceConfig {
270275 ProxyDeviceConnection : ProxyDeviceConnection {
271276 ClientId : clientId ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import (
1414
1515 // "github.com/urnetwork/glog"
1616
17+ "github.com/urnetwork/connect"
1718 "github.com/urnetwork/sdk"
1819 "github.com/urnetwork/server"
1920)
@@ -157,6 +158,8 @@ type ProxyDeviceState struct {
157158 Location * sdk.ConnectLocation `json:"location"`
158159
159160 PerformanceProfile * sdk.PerformanceProfile `json:"performance_profile"`
161+
162+ DnsResolverSettings * connect.DnsResolverSettings `json:"dns_resolver_settings"`
160163}
161164
162165func GetProxyDeviceConnection (ctx context.Context , proxyId server.Id ) (proxyDeviceConnection * ProxyDeviceConnection ) {
Original file line number Diff line number Diff line change @@ -211,14 +211,17 @@ func NewProxyDevice(
211211 deviceLocal .SetIngressSecurityPolicyGenerator (settings .IngressSecurityPolicyGenerator )
212212 deviceLocal .SetEgressSecurityPolicyGenerator (settings .EgressSecurityPolicyGenerator )
213213
214+ var dnsResolverSettings * connect.DnsResolverSettings
214215 if initialDeviceState := proxyDeviceConfig .InitialDeviceState ; initialDeviceState != nil {
215216 deviceLocal .SetPerformanceProfile (initialDeviceState .PerformanceProfile )
216217 deviceLocal .SetConnectLocation (initialDeviceState .Location )
218+ dnsResolverSettings = initialDeviceState .DnsResolverSettings
217219 }
218220
219- tnet , err := proxy .CreateNetTUN (
221+ tnet , err := proxy .CreateNetTunWithResolver (
220222 cancelCtx ,
221223 settings .Mtu ,
224+ dnsResolverSettings ,
222225 )
223226 if err != nil {
224227 return nil , err
You can’t perform that action at this time.
0 commit comments