S
S
stayHARD2015-08-05 12:31:53
Python
stayHARD, 2015-08-05 12:31:53

Why is the proxy not working on the server?

Hello.
Why might not using a proxy on the server work?
I do the same on the PC and on the server. On the PC it gives - 200 code, on the server - 503. What's wrong?
I actually do this on PC:

>>> import urllib2
>>> proxy = urllib2.ProxyHandler({'https': '63.141.245.50:2022'})
>>> opener = urllib2.build_opener(proxy)
>>> urllib2.install_opener(opener)
>>> a = urllib2.urlopen('http://www.yelp.com')
>>> print a.code
200

and here is the same on the server:
>>> import urllib2
>>> proxy = urllib2.ProxyHandler({'https': '63.141.245.50:2022'})
>>> opener = urllib2.build_opener(proxy)
>>> urllib2.install_opener(opener)
>>> a = urllib2.urlopen('http://www.yelp.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 445, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Temporarily Unavailable

What is the actual problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2015-08-05
@stayHARD

banned the server ip on the proxy
> what to do?
nothing - to take another
proxy server is bad and it has 503
> what to do?
nothing - take another server
to try without https

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question