'Default proxy for all socket connections.
Accepts either a string (hostname or IP address) for a SOCKS5 proxy on
the default port, **or** a ``tuple`` passed to ``socks.set_default_proxy``,
e.g. ``(socks.SOCKS4, \'localhost\', 1234)``.
>>> context.proxy = \'localhost\' #doctest: +ELLIPSIS
>>> r=remote(\'google.com\', 80)
Traceback (most recent call last):
ProxyConnectionError: Error connecting to SOCKS5 proxy localhost:1080: [Errno 111] Connection refused
>>> context.proxy = None
>>> r=remote(\'google.com\', 80, level=\'error\')'

@_validator
def proxy(self, proxy):

    if (not proxy):
        socket.socket = _original_socket
        return None
    if isinstance(proxy, str):
        proxy = (socks.SOCKS5, proxy)
    if (not isinstance(proxy, collections.Iterable)):
        raise AttributeError('proxy    must    be    a    string    hostname,    or    tuple    of    arguments    for    socks.set_default_proxy')
    socks.set_default_proxy(*proxy)
    socket.socket = socks.socksocket
    return proxy
