diff --git a/wsgi_intercept/__init__.py b/wsgi_intercept/__init__.py
index 487cd76..b659d75 100644
--- a/wsgi_intercept/__init__.py
+++ b/wsgi_intercept/__init__.py
@@ -50,6 +50,11 @@ Note especially that ``app_create_fn`` is a *function object* returning a WSGI
 application; ``script_name`` becomes ``SCRIPT_NAME`` in the WSGI app's
 environment, if set.
 
+Note also that if ``http_proxy`` or ``https_proxy`` is set in the environment
+this can cause difficulties with some of the intercepted libraries. If 
+requests or urllib is being used, these will raise an exception if one of
+those variables is set.
+
 Install
 =======
 
diff --git a/wsgi_intercept/requests_intercept.py b/wsgi_intercept/requests_intercept.py
index cdd304a..586b752 100644
--- a/wsgi_intercept/requests_intercept.py
+++ b/wsgi_intercept/requests_intercept.py
@@ -1,6 +1,7 @@
 """Intercept HTTP connections that use `requests <http://docs.python-requests.org/en/latest/>`_.
 """
 
+import os
 import sys
 
 from . import WSGI_HTTPConnection, WSGI_HTTPSConnection, wsgi_fake_socket
@@ -32,6 +33,9 @@ class HTTPS_WSGIInterceptor(WSGI_HTTPSConnection, HTTPSConnection):
 
 
 def install():
+    if 'http_proxy' in os.environ or 'https_proxy' in os.environ:
+        raise RuntimeError(
+            'http_proxy or https_proxy set in environment, please unset')
     HTTPConnectionPool.ConnectionCls = HTTP_WSGIInterceptor
     HTTPSConnectionPool.ConnectionCls = HTTPS_WSGIInterceptor
 
diff --git a/wsgi_intercept/urllib_intercept.py b/wsgi_intercept/urllib_intercept.py
index 3eca406..31d8f46 100644
--- a/wsgi_intercept/urllib_intercept.py
+++ b/wsgi_intercept/urllib_intercept.py
@@ -1,5 +1,8 @@
 """Intercept HTTP connections that use urllib.request (Py3) aka urllib2 (Python 2).
 """
+
+import os
+
 try:
     import urllib.request as url_lib
 except ImportError:
@@ -27,6 +30,9 @@ class WSGI_HTTPSHandler(url_lib.HTTPSHandler):
 
 
 def install_opener():
+    if 'http_proxy' in os.environ or 'https_proxy' in os.environ:
+        raise RuntimeError(
+            'http_proxy or https_proxy set in environment, please unset')
     handlers = [WSGI_HTTPHandler()]
     if WSGI_HTTPSHandler is not None:
         handlers.append(WSGI_HTTPSHandler())

kwarg error when $http_proxy is set in environ
```bash
$ echo $http_proxy
some_proxy.com:1234
```
and run the [requests example](http://wsgi-intercept.readthedocs.org/en/latest/requests.html), I got this error:
```
Traceback (most recent call last):
  File "test.py", line 20, in <module>
    resp = requests.get(url)
  File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 60, in get
    return request('get', url, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 49, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 457, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 569, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 362, in send
    timeout=timeout
  File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 511, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 231, in _get_conn
    return conn or self._new_conn()
  File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 192, in _new_conn
    strict=self.strict, **self.conn_kw)
  File "/usr/local/lib/python2.7/site-packages/wsgi_intercept/requests_intercept.py", line 22, in __init__
    WSGI_HTTPConnection.__init__(self, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'socket_options'
```
and the kwargs of wsgi_intercept/requests_intercept.py:HTTP_WSGIInterceptor.__init__ is 
```
{'strict': False, 'host': 'some_proxy.com', 'socket_options': [], 'timeout': <object object at 0x1028490e0>, 'port': 1234}
```
diff --git a/test/install.py b/test/install.py
index 225e109..65262cd 100644
--- a/test/install.py
+++ b/test/install.py
@@ -1,9 +1,10 @@
+import os
 import wsgi_intercept
 
 
 class BaseInstalledApp(object):
     def __init__(self, app, host, port=80, script_name='',
-                 install=None, uninstall=None):
+                 install=None, uninstall=None, proxy=None):
         self.app = app
         self.host = host
         self.port = port
@@ -12,6 +13,7 @@ class BaseInstalledApp(object):
         self._uninstall = uninstall or (lambda: None)
         self._hits = 0
         self._internals = {}
+        self._proxy = proxy
 
     def __call__(self, environ, start_response):
         self._hits += 1
@@ -32,10 +34,14 @@ class BaseInstalledApp(object):
         wsgi_intercept.remove_wsgi_intercept(self.host, self.port)
 
     def install(self):
+        if self._proxy:
+            os.environ['http_proxy'] = self._proxy
         self._install()
         self.install_wsgi_intercept()
 
     def uninstall(self):
+        if self._proxy:
+            del os.environ['http_proxy']
         self.uninstall_wsgi_intercept()
         self._uninstall()
 
@@ -56,9 +62,9 @@ def installer_class(module=None, install=None, uninstall=None):
         uninstall = uninstall or getattr(module, 'uninstall', None)
 
     class InstalledApp(BaseInstalledApp):
-        def __init__(self, app, host, port=80, script_name=''):
+        def __init__(self, app, host, port=80, script_name='', proxy=None):
             BaseInstalledApp.__init__(
                 self, app=app, host=host, port=port, script_name=script_name,
-                install=install, uninstall=uninstall)
+                install=install, uninstall=uninstall, proxy=proxy)
 
     return InstalledApp
diff --git a/test/test_http_client.py b/test/test_http_client.py
index 3ca09b4..0622f6e 100644
--- a/test/test_http_client.py
+++ b/test/test_http_client.py
@@ -42,6 +42,18 @@ def test_other():
         assert app.success()
 
 
+def test_proxy_handling():
+    """Proxy variable no impact."""
+    with InstalledApp(wsgi_app.simple_app, host=HOST, port=80,
+                      proxy='some.host:1234') as app:
+        http_client = http_lib.HTTPConnection(HOST)
+        http_client.request('GET', '/')
+        content = http_client.getresponse().read()
+        http_client.close()
+        assert content == b'WSGI intercept successful!\n'
+        assert app.success()
+
+
 def test_app_error():
     with InstalledApp(wsgi_app.raises_app, host=HOST, port=80):
         http_client = http_lib.HTTPConnection(HOST)
diff --git a/test/test_httplib2.py b/test/test_httplib2.py
index 9fa91d1..9a67e28 100644
--- a/test/test_httplib2.py
+++ b/test/test_httplib2.py
@@ -47,6 +47,17 @@ def test_bogus_domain():
             'httplib2_intercept.HTTP_WSGIInterceptorWithTimeout("_nonexistant_domain_").connect()')
 
 
+def test_proxy_handling():
+    """Proxy has no impact."""
+    with InstalledApp(wsgi_app.simple_app, host=HOST, port=80,
+                      proxy='some_proxy.com:1234') as app:
+        http = httplib2.Http()
+        resp, content = http.request(
+            'http://some_hopefully_nonexistant_domain:80/')
+        assert content == b'WSGI intercept successful!\n'
+        assert app.success()
+
+
 def test_https():
     with InstalledApp(wsgi_app.simple_app, host=HOST, port=443) as app:
         http = httplib2.Http()
diff --git a/test/test_requests.py b/test/test_requests.py
index 304d178..8005f93 100644
--- a/test/test_requests.py
+++ b/test/test_requests.py
@@ -1,3 +1,4 @@
+import os
 import py.test
 from wsgi_intercept import requests_intercept, WSGIAppError
 from test import wsgi_app
@@ -40,6 +41,18 @@ def test_bogus_domain():
             'requests.get("http://_nonexistant_domain_")')
 
 
+def test_proxy_handling():
+    with py.test.raises(RuntimeError) as exc:
+        with InstalledApp(wsgi_app.simple_app, host=HOST, port=80,
+                          proxy='some_proxy.com:1234'):
+            requests.get('http://some_hopefully_nonexistant_domain:80/')
+    assert 'http_proxy or https_proxy set in environment' in str(exc.value)
+    # We need to do this by hand because the exception was raised
+    # during the entry of the context manager, so the exit handler
+    # wasn't reached.
+    del os.environ['http_proxy']
+
+
 def test_https():
     with InstalledApp(wsgi_app.simple_app, host=HOST, port=443) as app:
         resp = requests.get('https://some_hopefully_nonexistant_domain:443/')
diff --git a/test/test_urllib.py b/test/test_urllib.py
index 82daff7..83d793f 100644
--- a/test/test_urllib.py
+++ b/test/test_urllib.py
@@ -1,3 +1,4 @@
+import os
 import py.test
 from wsgi_intercept import urllib_intercept, WSGIAppError
 from test import wsgi_app
@@ -32,6 +33,19 @@ def test_http_other_port():
         assert environ['wsgi.url_scheme'] == 'http'
 
 
+def test_proxy_handling():
+    """Like requests, urllib gets confused about proxy early on."""
+    with py.test.raises(RuntimeError) as exc:
+        with InstalledApp(wsgi_app.simple_app, host=HOST, port=80,
+                          proxy='some.host:1234'):
+            url_lib.urlopen('http://some_hopefully_nonexistant_domain:80/')
+    assert 'http_proxy or https_proxy set in environment' in str(exc.value)
+    # We need to do this by hand because the exception was raised
+    # during the entry of the context manager, so the exit handler
+    # wasn't reached.
+    del os.environ['http_proxy']
+
+
 def test_https():
     with InstalledApp(wsgi_app.simple_app, host=HOST, port=443) as app:
         url_lib.urlopen('https://some_hopefully_nonexistant_domain:443/')

pip install -e .[testing]
parse_log_pytest
pytest>=2.4 httplib2 requests>=2.0.1 pytest
apt-get update apt-get install -y gcc
3.5
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
httplib2==0.22.0
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
requests==2.27.1
six==1.17.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
-e git+https://github.com/cdent/wsgi-intercept.git@3048a0921675822f5f27567d63ecca094077dc25#egg=wsgi_intercept
zipp==3.6.0

name: wsgi-intercept
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - httplib2==0.22.0
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - requests==2.27.1
      - six==1.17.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/wsgi-intercept

test/test_requests.py::test_proxy_handling test/test_urllib.py::test_proxy_handling
test/test_httplib2.py::test_bogus_domain test/test_httplib2.py::test_https test/test_httplib2.py::test_https_default_port test/test_requests.py::test_bogus_domain test/test_requests.py::test_https test/test_requests.py::test_https_default_port test/test_requests.py::test_https_not_intercepted
test/test_http_client.py::test_http test/test_http_client.py::test_https test/test_http_client.py::test_other test/test_http_client.py::test_proxy_handling test/test_http_client.py::test_app_error test/test_http_client.py::test_http_not_intercepted test/test_http_client.py::test_https_not_intercepted test/test_httplib2.py::test_http test/test_httplib2.py::test_http_default_port test/test_httplib2.py::test_http_other_port test/test_httplib2.py::test_proxy_handling test/test_httplib2.py::test_app_error test/test_requests.py::test_http test/test_requests.py::test_http_default_port test/test_requests.py::test_http_other_port test/test_requests.py::test_app_error test/test_requests.py::test_http_not_intercepted test/test_urllib.py::test_http test/test_urllib.py::test_http_default_port test/test_urllib.py::test_http_other_port test/test_urllib.py::test_https test/test_urllib.py::test_https_default_port test/test_urllib.py::test_app_error test/test_urllib.py::test_http_not_intercepted test/test_urllib.py::test_https_not_intercepted
wsgi_intercept/requests_intercept.py wsgi_intercept/__init__.py wsgi_intercept/urllib_intercept.py
wsgi_intercept/requests_intercept.py wsgi_intercept/__init__.py wsgi_intercept/urllib_intercept.py