This repository was archived by the owner on Jul 9, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
src/Titanium.Web.Proxy/Network/Tcp Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -287,17 +287,8 @@ private async Task<TcpServerConnection> createServerConnection(string remoteHost
287
287
var hostname = useUpstreamProxy ? externalProxy . HostName : remoteHostName ;
288
288
var port = useUpstreamProxy ? externalProxy . Port : remotePort ;
289
289
290
- IPHostEntry ipHostEntry ;
291
- if ( IPAddress . TryParse ( hostname , out var ipAddress ) )
292
- {
293
- ipHostEntry = await Dns . GetHostEntryAsync ( ipAddress ) ;
294
- }
295
- else
296
- {
297
- ipHostEntry = await Dns . GetHostEntryAsync ( hostname ) ;
298
- }
299
-
300
- if ( ipHostEntry == null || ipHostEntry . AddressList . Length == 0 )
290
+ var ipAddresses = await Dns . GetHostAddressesAsync ( hostname ) ;
291
+ if ( ipAddresses == null || ipAddresses . Length == 0 )
301
292
{
302
293
throw new Exception ( $ "Could not resolve the hostname { hostname } ") ;
303
294
}
@@ -307,8 +298,6 @@ private async Task<TcpServerConnection> createServerConnection(string remoteHost
307
298
session . TimeLine [ "Dns Resolved" ] = DateTime . Now ;
308
299
}
309
300
310
- var ipAddresses = ipHostEntry . AddressList ;
311
-
312
301
for ( int i = 0 ; i < ipAddresses . Length ; i ++ )
313
302
{
314
303
try
You can’t perform that action at this time.
0 commit comments