Archived Forum Post

Index of archived forum posts

Question:

Squid proxy and Chilkat Http proxy

Jun 27 '13 at 12:47

Hi,

I'm using squid proxy server which is http proxy, but in Chilkat my ips only works when I use SocksHostname and SocksPort but don't work with ProxyDomain and ProxyPort. In other software which use only http proxy my proxies works good. Why in Chilkat doesn't work as http proxy but as socks?


Accepted Answer

The LastErrorText above indicates that the connect system call times out. (The connect system call is this: http://linux.die.net/man/2/connect ) It's the same system call whether it's Linux, Windows, Mac OS X, iOS, etc.

In other words, internally Chilkat called the "connect" system call to 91.204.xx.xx:3128, but there was no response.

I don't understand how what you described is possible, because regardless of the protocol spoken by the server, whether it be SOCKS, HTTP proxy, or anything else, the 1st thing that must succeed is that the TCP connection become established. Once it's established, then communication begins. The failure is at the point prior to any communication. Therefore, in the working case the connection establishment is not blocked and something on the remote side is listening at port 3128 and the connection is accepted. At that point the communication begins. For the failed case, the connection isn't even established. It can ONLY be that something is blocking the connection, or nothing is listening at that port..


Answer

What programming language, operating system, and version of Chilkat do you use?


Answer

.NET 4.0

ChilkatLog:
      SynchronousRequest:
        DllDate: Apr 30 2013
        ChilkatVersion: 9.4.1.11
        UnlockPrefix: xx
        Username: xx:xx
        Architecture: Little Endian; 32-bit
        Language: .NET 4.0
        VerboseLogging: 0
        domain: www.blog.co.uk
        port: 80
        ssl: 0
        RequestData:
          HttpVersion: 1.1
          Verb: GET
          Path: /register/register.php
          Charset: windows-1250
          SendCharset: 0
          MimeHeader: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7) Gecko/20101111 Firefox/4.0b7
    Accept: text/html,application/xhtml+xml,application/xml;
    \tq=\"0.9,*/*\"; q=\"0.8\"
        --RequestData
        ReadTimeout: 100
        ConnectTimeout: 100
        httpConnect:
          hostname: www.blog.co.uk
          port: 80
          ssl: 0
          Need to establish connection to the HTTP server...
          proxyDomain: 91.204.xx.xx
          proxyPort: 3128
          ConnectTimeoutMs_1: 100000
          This is an IPV4 numeric address.
          Hostname to IP address resolution not needed.
          AddrInfoList:
            AddrInfo:
              ai_flags: 4
              ai_family: 2
              ai_socktype: 1
              ai_protocol: 0
              ai_addrlen: 16
              ai_canonname: (NULL)
            --AddrInfo
          --AddrInfoList
          Connecting to IPV4 address.
          ipAddress2: 91.204.xx.xx
          timeout waiting for connect to complete;
          Connect function failed
          connectTimeoutMs: 100000
          idleTimeoutMs: 100000
          Failed to connect.
        --httpConnect
        connectTime1: Elapsed time: 99981 millisec
        totalTime: Elapsed time: 99981 millisec
        Failed.
      --SynchronousRequest
    --ChilkatLog

Answer

No, because when I use SocksHostname and SocksPort

SocksHostname: 91.204.xx.xx
SocksPort: 3128

it's working OK, I don't know why because 91.204.xx.xx is http proxy (squid proxy server) - not socks


Answer

My mistake, now I've checked LastErrorText for

SocksHostname: 91.204.xx.xx
SocksPort: 3128

and noticed that it's not used while making connection, so before I think that it's worked OK. Problem as You said was with connection to IP and after solving this now proxy works good as http proxy and is used correctly

Sorry for taking Yours time for my stupidity