<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Accessing ArcGIS Online REST Services through a proxy with Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575921#M45131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post the traceback?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Sep 2014 20:14:25 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2014-09-05T20:14:25Z</dc:date>
    <item>
      <title>Accessing ArcGIS Online REST Services through a proxy with Python</title>
      <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575918#M45128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run a script to access an ArcGIS Online REST web service and am behind an orginizational firewall, so I need to go over an authenticated proxy. My understanding is that urllib2 is supposed to pull the proxy settings from my system automatically so I shouldn't need to add any code dealing with that, but I keep getting a socket timeout error (60010) right after the script attempts to establish a connection -- I think this has to do with the proxy, but maybe I'm wrong.&amp;nbsp; Has anyone else run into this problem and found a sollution?&amp;nbsp; I tried importing the'socket' module and setting the timout value to 'NONE', as well as setting the expiration to a larger value, but the error keeps appearing after 1 minute.&amp;nbsp; I've attached the part of my code dealing with the connection to the service -- does anyone out there have any ideas?&amp;nbsp; Any feedback would be highly appreciated!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/legacyfs/online/7642_socket.PNG"&gt;&lt;IMG alt="socket.PNG" class="image-1 jive-image" height="270" src="https://community.esri.com/legacyfs/online/7642_socket.PNG" style="height: auto;" width="224" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="python" name="code"&gt;import json, urllib, urllib2 import sys, os import arcpy import shutil&amp;nbsp; class GetToken(object): &amp;nbsp;&amp;nbsp;&amp;nbsp; # find feature service attachments, send to directory &amp;nbsp;&amp;nbsp;&amp;nbsp; def urlopen(self, url, data=None): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # open url, send response &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; referer = "http://www.arcgis.com/arcgis/rest" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; req = urllib2.Request(url) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.add_header('Referer', referer) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if data: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; response = urllib2.urlopen(req, data) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; response = urllib2.urlopen(req) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return response &amp;nbsp;&amp;nbsp;&amp;nbsp; def gentoken(self, username, password, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; referer = 'www.arcgis.com', expiration=60): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # gets token from referrer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query_dict = {'username': username, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'password': password, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'expiration': str(expiration), &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'client': 'referer', &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'referer': referer, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'f': 'json'} &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query_string = urllib.urlencode(query_dict) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token_url = "https://www.arcgis.com/sharing/rest/generateToken" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token_response = urllib.urlopen(token_url, query_string) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token = json.loads(token_response.read()) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if "token" not in token: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print token['messages'] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return token['token']&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 14:14:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575918#M45128</guid>
      <dc:creator>TrilliumLevine1</dc:creator>
      <dc:date>2014-09-04T14:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ArcGIS Online REST Services through a proxy with Python</title>
      <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575919#M45129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you need to configure your proxies in your code. See &lt;A href="http://stackoverflow.com/questions/1450132/proxy-with-urllib2"&gt;this thread on Stack Overflow&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 16:39:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575919#M45129</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2014-09-04T16:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ArcGIS Online REST Services through a proxy with Python</title>
      <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575920#M45130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response, Jason.&amp;nbsp; I've tried all the variations mentioned on the link you sent, as well as others.&amp;nbsp; Right now the top of my script looks like below, and I also set my environment variables appropriately for http_proxy and https_proxy.&amp;nbsp; Right now I'm getting an error on the splituser def inside of urllib telling me that a string or buffer is expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

import sys, os
import arcpy
import shutil
import re


# set proxies
proxy = urllib2.ProxyHandler({
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'http': '192.168.104.103',
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'https': '192.168.104.103'
})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
class GetToken(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; # find feature service attachments, send to directory


&amp;nbsp;&amp;nbsp;&amp;nbsp; def urlopen(self, url, data=None):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # open url, send response
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; referer = "&lt;A href="http://www.arcgis.com/arcgis/rest" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.arcgis.com/arcgis/rest&lt;/A&gt;"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; req = urllib2.Request(url)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; req.add_header('Referer', referer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if data:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; response = urllib2.urlopen(req, data)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; response = urllib2.urlopen(req)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return response


&amp;nbsp;&amp;nbsp;&amp;nbsp; def gentoken(self, username, password,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; referer = 'www.arcgis.com', expiration=60):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # gets token from referrer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query_dict = {'username': username,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'password': password,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'expiration': str(expiration),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'client': 'referer',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'referer': referer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'f': 'json'}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query_string = urllib.urlencode(query_dict)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token_url = "&lt;A href="https://www.arcgis.com/sharing/rest/generateToken" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token_response = urllib.urlopen(token_url, query_string)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; token = json.loads(token_response.read())
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if "token" not in token:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print token['messages']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return token['token']

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:47:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575920#M45130</guid>
      <dc:creator>TrilliumLevine1</dc:creator>
      <dc:date>2021-12-12T00:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ArcGIS Online REST Services through a proxy with Python</title>
      <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575921#M45131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post the traceback?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 20:14:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575921#M45131</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2014-09-05T20:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ArcGIS Online REST Services through a proxy with Python</title>
      <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575922#M45132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yep, here's the traceback:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module&amp;gt; C:\Users\tle\Desktop\Scripts\dl_extract2.py 161&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; main C:\Users\tle\Desktop\Scripts\dl_extract2.py 157&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __init__ C:\Users\tle\Desktop\Scripts\dl_extract2.py 53&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gentoken C:\Users\tle\Desktop\Scripts\dl_extract2.py 40&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urlopen C:\Python26\ArcGIS10.0\lib\urllib.py 88&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; open C:\Python26\ArcGIS10.0\lib\urllib.py 207&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; open_https C:\Python26\ArcGIS10.0\lib\urllib.py 439&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endheaders C:\Python26\ArcGIS10.0\lib\httplib.py 904&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _send_output C:\Python26\ArcGIS10.0\lib\httplib.py 776&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; send C:\Python26\ArcGIS10.0\lib\httplib.py 735&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect C:\Python26\ArcGIS10.0\lib\httplib.py 1112&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wrap_socket C:\Python26\ArcGIS10.0\lib\ssl.py 350&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __init__ C:\Python26\ArcGIS10.0\lib\ssl.py 118&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do_handshake C:\Python26\ArcGIS10.0\lib\ssl.py 293&amp;nbsp; &lt;/P&gt;&lt;P&gt;IOError: [Errno socket error] [Errno 1] _ssl.c:480: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 08:19:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575922#M45132</guid>
      <dc:creator>TrilliumLevine1</dc:creator>
      <dc:date>2014-09-08T08:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ArcGIS Online REST Services through a proxy with Python</title>
      <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575923#M45133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This actually turned out to be a pretty easy fix.&amp;nbsp; All that were needed in my case were the system variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;http_proxy: http//:user:password@server:port&lt;/P&gt;&lt;P&gt;https_proxy: http//:user:password@server:port&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://lukasa.co.uk/2013/07/Python_Requests_And_Proxies/"&gt;This link&lt;/A&gt; explains why the http protocol is used for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code was not needed -- in fact, the script threw a 404 error when it was included:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proxy = urllib2.ProxyHandler({&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string"&gt;'http': &lt;SPAN class="string"&gt;'192.168.104.103'&lt;/SPAN&gt;,&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string"&gt;'https': &lt;SPAN class="string"&gt;'192.168.104.103'&lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;})&amp;nbsp; &lt;/P&gt;&lt;P&gt;opener = urllib2.build_opener(proxy)&amp;nbsp; &lt;/P&gt;&lt;P&gt;urllib2.install_opener(opener)&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 10:03:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575923#M45133</guid>
      <dc:creator>TrilliumLevine1</dc:creator>
      <dc:date>2014-09-10T10:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing ArcGIS Online REST Services through a proxy with Python</title>
      <link>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575924#M45134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more discovery:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turns out that (in &lt;EM&gt;my&lt;/EM&gt;&lt;SPAN&gt; situation, ymmv) the authentication is key. So setting the username in the proxy"definition" is mandatory. Either in the environment setting or in proxies = urllib2.ProxyHandler I needed to add &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2F" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;STRONG&gt;username:password@&lt;/STRONG&gt;abc.com:1234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth, Bert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 06:16:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/accessing-arcgis-online-rest-services-through-a/m-p/575924#M45134</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2016-05-24T06:16:04Z</dc:date>
    </item>
  </channel>
</rss>

