Using authentication with Proxy

285 views Asked by At

Sorry for the double post: a friend of mine asked this on the mailing list but no one answered.

I would like to know how to correctly use the ProxyAuthenticationRequired event of an HTTPSocket. I mean, how can I pass the login/password if the proxy asks for the authentication?

Thanks!

1

There are 1 answers

1
Andrew Lambert On BEST ANSWER

I've never used a proxy with the HTTPSocket class, but I think this is how it works.

The ProxyAuthenticationRequired event passes four parameters, the proxy realm as a string, the HTTP headers as an InternetHeaders object, and the username and password as strings. The username and password are passed ByRef, so I believe the idea is for you to set these parameters yourself and then Return True from the ProxyAuthenticationRequired event:

Event ProxyAuthenticationRequired(Realm as String, Headers as InternetHeaders, ByRef Name as String, ByRef Password as String ) As Boolean
  Name = "MyUserName"
  Password = "MyPass"
  Return True
End Event