-
-
Notifications
You must be signed in to change notification settings - Fork 11
Proxying Example
Andrew Lambert edited this page Jan 8, 2023
·
10 revisions
libcURL supports several proxy types, but basic use is the same for all of them. To enable proxying on an instance of EasyHandle or cURLClient, specify the proxy address, port, type, username, etc. to the appropriate instance of ProxyEngine (e.g. EasyHandle.ProxyEngine, cURLClient.Proxy).
This example performs a synchronous HTTP GET request on the calling thread using a SOCKS5 proxy server.
Dim curl As New cURLClient
curl.Proxy.Address = "192.168.1.10" ' setting the address enables proxying
curl.Proxy.Port = 1081 ' default is 1080
curl.Proxy.Username = "foo" ' optional
curl.Proxy.Password = "bar" ' optional
curl.Proxy.Type = libcURL.ProxyType.SOCKS5
If curl.Get("http://www.example.com/") Then
Dim page As String = curl.GetDownloadedData()
Else
MsgBox(libcURL.FormatError(curl.LastError))
End If
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.