socket.error connection refused

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vania

    #1

    socket.error connection refused

    Hi, I'm not sure this is the proper forum but I try nevertheless.
    The problem I'am facing is that the socket library always fail to
    connect to an URL. The net effect is that I can not use setuptools.
    I'm using Python2.4 on a windows XPPRO Sp2 machine.
    The firewall is disabled.
    There is no NLTM proxy.
    I connect to the internet through a NAT server (and it works).
    Other than with easy_install I tried to connect to a number of external
    urls
    (all of them running) and even to localhost,
    directly in script using urllib
    and the error is always the same errno: 10061 connection refused.
    Any ideas?

  • robert

    #2
    Re: socket.error connection refused

    Vania wrote:
    Hi, I'm not sure this is the proper forum but I try nevertheless.
    The problem I'am facing is that the socket library always fail to
    connect to an URL. The net effect is that I can not use setuptools.
    I'm using Python2.4 on a windows XPPRO Sp2 machine.
    The firewall is disabled.
    There is no NLTM proxy.
    I connect to the internet through a NAT server (and it works).
    Other than with easy_install I tried to connect to a number of external
    urls
    (all of them running) and even to localhost,
    directly in script using urllib
    and the error is always the same errno: 10061 connection refused.
    Any ideas?

    urllib.urlopen can pick up an invalid proxy setting from environ or IE-settings.

    routers/NAT servers sometimes need a 2nd tick - all browsers try it 2..4 times before displaying "no connection" - this is (unfortunately) not the default behavior of the "browser" urllib.

    if bare
    >>import httplib
    >>h=httplib.HTT PConnection('ww w.google.com')
    >>h.connect()
    >>h.request('GE T','/')
    >>h.getresponse ().read()
    '<HTML><HEAD><m eta http-equiv="content-type" content="text/html;charset=ut f-8">\n<TITLE> 302 Moved</TITLE></HEAD><BODY>\n<H 1>302 Moved</H1>\nThe document has moved\n<A HREF="http://www.google.de/">here</A>.\r\n</BODY></HTML>\r\n'
    >>>
    fails on multiple trials, then you have a very strange network setup. maybe multiple/confusing NIC's ...


    Robert

    Comment

    • Vania

      #3
      Re: socket.error connection refused


      Thanks for the explanation.
      Probably the fact that I was working inside a virtual machine
      didn't help.

      Vania

      robert ha scritto:
      Vania wrote:
      Hi, I'm not sure this is the proper forum but I try nevertheless.
      The problem I'am facing is that the socket library always fail to
      connect to an URL. The net effect is that I can not use setuptools.
      I'm using Python2.4 on a windows XPPRO Sp2 machine.
      The firewall is disabled.
      There is no NLTM proxy.
      I connect to the internet through a NAT server (and it works).
      Other than with easy_install I tried to connect to a number of external
      urls
      (all of them running) and even to localhost,
      directly in script using urllib
      and the error is always the same errno: 10061 connection refused.
      Any ideas?
      >
      >
      urllib.urlopen can pick up an invalid proxy setting from environ or IE-settings.
      >
      routers/NAT servers sometimes need a 2nd tick - all browsers try it 2..4 times before displaying "no connection" - this is (unfortunately) not the default behavior of the "browser" urllib.
      >
      if bare
      >
      >import httplib
      >h=httplib.HTTP Connection('www .google.com')
      >h.connect()
      >h.request('GET ','/')
      >h.getresponse( ).read()
      '<HTML><HEAD><m eta http-equiv="content-type" content="text/html;charset=ut f-8">\n<TITLE> 302 Moved</TITLE></HEAD><BODY>\n<H 1>302 Moved</H1>\nThe document has moved\n<A HREF="http://www.google.de/">here</A>.\r\n</BODY></HTML>\r\n'
      >>
      >
      fails on multiple trials, then you have a very strange network setup. maybe multiple/confusing NIC's ...
      >
      >
      Robert

      Comment

      Working...