4

I have script to GET HTTP content and I need bypass proxy (connect directly to webserver IP).

Is it possible without changing registry in Windows? This code is going through proxy defined in system.

Thanks for advice Best regards.

$url='https://10.10.10.10/check';
$webClient = new-object System.Net.WebClient;
$output = $webClient.DownloadString($url)
0

1 Answer 1

6

According to the documentation you have to set the proxy to a blank proxy instance. Try this:

$url = "https://10.10.10.10/check"
$webClient = New-Object System.Net.WebClient
$webClient.Proxy = [System.Net.GlobalProxySelection]::GetEmptyWebProxy()
$output = $webClient.DownloadString($url)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.