Hello! I'm wondering if anybody can help me with the Proxy on httpclient. I'm 
using the following code to set a local proxy and get a session id.
    
    
    import httpclient, json, strutils
    
    var client = newHttpClient(proxy=newProxy("http://127.0.0.1:8888";))
    var session = 
parseJson(client.getContent("https://yummy.xyz.com/get-session";))["session"].str
    echo session
    

At some point during the getContent call, it attempts to connect to my proxy, 
but it seems to have dropped the server name (yummy.xyz.com). Here are the raw 
headers it sends to my proxy:
    
    
    CONNECT /get-session HTTP/1.1
    Host: /get-session
    Connection: Keep-Alive
    user-agent: Nim httpclient/0.17.0
    

When I run my program, it gives me the following error
    
    
    Error: unhandled exception: The proxy server rejected a CONNECT request, so 
a secure connection could not be established. [HttpRequestError]
    

My proxy says it rejected the request because it rejected the connection 
because the DNS lookup failed (error 502).

Am I doing something wrong here?

Reply via email to