function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ASmithASmith 

VB.NET Proxy Issue

I have a VB.NET script and am unable to connect when I run it behind our proxy server.  I have, however, successfully connected when I bypass our proxy using an alternate DSL connection.  I have included the connection error message below:

An unhandled exception of type 'System.Net.WebException' occured in System.dll.  Additional information: The underlying connection was closed: Unable to connect to the remote server.

I have also attempted many of the suggestions listed on this message board with no success.  Below is my login code as it stands now.  Any help would be greatly appreciated.

sForce.Proxy = New System.Net.WebProxy("http://ourproxyserver", 8083)

sForce.Credentials = New System.Net.NetworkCredential("myusername", "mypassword")

ret = sForce.login(APIVersion, UserName, Password, True, "describer")

DevAngelDevAngel

Hi ASmith,

I'm not an expert on Proxy, but what happens when you try something like this?

Assuming there is a server on you network with an address like 10.0.1.10 and it has a name like ourproxyserver, so that the host file would look like

10.0.1.10      ourproxyserver

then this should work:

 sForce.Proxy = New System.Net.WebProxy("ourproxyserver", 8083)

sForce.Proxy.Credentials = New System.Net.NetworkCredential("username", "password")

ret = sForce.login(APIVersion, UserName, Password, True, "describer")

So, rather than use a url use the network name of the server.