Hi Im trying to get the page content from a website, but security I want to use some proxies but it doesn't work when there is ports specified.
Here is the code
import httpclient
let proxy = newProxy("ip:port")
let client = newHttpClient(proxy = proxy)
echo client.getContent("https://somewebsite.com")
I got the following error:
/home/gabriel/Bureau/NIM/nimtrogen/gen.nim(123) gen
/home/gabriel/Bureau/NIM/nimtrogen/gen.nim(68) check
/usr/lib/nim/pure/httpclient.nim(1095) getContent
/usr/lib/nim/pure/httpclient.nim(1090) get
/usr/lib/nim/pure/httpclient.nim(1066) request
/usr/lib/nim/pure/httpclient.nim(1042) request
/usr/lib/nim/pure/httpclient.nim(992) requestAux
/usr/lib/nim/pure/httpclient.nim(879) newConnection
/usr/lib/nim/pure/net.nim(1859) dial
/usr/lib/nim/pure/nativesockets.nim(303) getAddrInfo
/usr/lib/nim/pure/includes/oserr.nim(94) raiseOSError
Error: unhandled exception: Invalid argument
Additional info: "Name or service not known" [OSError]
Thanks for your help
I tryed that but it give my an other error
/home/gabriel/Bureau/NIM/nimtrogen/test.nim(7) test
/usr/lib/nim/pure/httpclient.nim(1095) getContent
/usr/lib/nim/pure/httpclient.nim(1090) get
/usr/lib/nim/pure/httpclient.nim(1066) request
/usr/lib/nim/pure/httpclient.nim(1042) request
/usr/lib/nim/pure/httpclient.nim(992) requestAux
/usr/lib/nim/pure/httpclient.nim(887) newConnection
/usr/lib/nim/pure/net.nim(803) wrapConnectedSocket
/usr/lib/nim/pure/net.nim(915) socketError
/usr/lib/nim/pure/net.nim(517) raiseSSLError
[[reraised from:
/home/gabriel/Bureau/NIM/nimtrogen/test.nim(7) test
/usr/lib/nim/pure/httpclient.nim(1095) getContent
/usr/lib/nim/pure/httpclient.nim(1090) get
/usr/lib/nim/pure/httpclient.nim(1066) request
/usr/lib/nim/pure/httpclient.nim(1042) request
/usr/lib/nim/pure/httpclient.nim(992) requestAux
/usr/lib/nim/pure/httpclient.nim(891) newConnection
]]
Error: unhandled exception: error:1408F10B:SSL routines:ssl3_get_record:wrong version number [SslError]
Note that Im getting the content from google.com
Well I fix it using HTTP only proxies and not SSL ones
Thanks for you help