✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python27/lib/python2.7/site-packages/paste//proxy.py
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
An application that proxies WSGI requests to a remote server.

TODO:

* Send ``Via`` header?  It's not clear to me this is a Via in the
  style of a typical proxy.

* Other headers or metadata?  I put in X-Forwarded-For, but that's it.

* Signed data of non-HTTP keys?  This would be for things like
  REMOTE_USER.

* Something to indicate what the original URL was?  The original host,
  scheme, and base path.

* Rewriting ``Location`` headers?  mod_proxy does this.

* Rewriting body?  (Probably not on this one -- that can be done with
  a different middleware that wraps this middleware)

* Example::  
    
    use = egg:Paste#proxy
    address = http://server3:8680/exist/rest/db/orgs/sch/config/
    allowed_request_methods = GET
  
"""

import httplib
import urlparse
import urllib

from paste import httpexceptions
from paste.util.converters import aslist

# Remove these headers from response (specify lower case header
# names):
filtered_headers = (     
    'transfer-encoding',
    'connection',
    'keep-alive',
    'proxy-authenticate',
    'proxy-authorization',
    'te',
    'trailers',
    'upgrade',
)

class Proxy(object):

    def __init__(self, address, allowed_request_methods=(),
                 suppress_http_headers=()):
        self.address = address
        self.parsed = urlparse.urlsplit(address)
        self.scheme = self.parsed[0].lower()
        self.host = self.parsed[1]
        self.path = self.parsed[2]
        self.allowed_request_methods = [
            x.lower() for x in allowed_request_methods if x]
        
        self.suppress_http_headers = [
            x.lower() for x in suppress_http_headers if x]

    def __call__(self, environ, start_response):
        if (self.allowed_request_methods and 
            environ['REQUEST_METHOD'].lower() not in self.allowed_request_methods):
            return httpexceptions.HTTPBadRequest("Disallowed")(environ, start_response)

        if self.scheme == 'http':
            ConnClass = httplib.HTTPConnection
        elif self.scheme == 'https':
            ConnClass = httplib.HTTPSConnection
        else:
            raise ValueError(
                "Unknown scheme for %r: %r" % (self.address, self.scheme))
        conn = ConnClass(self.host)
        headers = {}
        for key, value in environ.items():
            if key.startswith('HTTP_'):
                key = key[5:].lower().replace('_', '-')
                if key == 'host' or key in self.suppress_http_headers:
                    continue
                headers[key] = value
        headers['host'] = self.host
        if 'REMOTE_ADDR' in environ:
            headers['x-forwarded-for'] = environ['REMOTE_ADDR']
        if environ.get('CONTENT_TYPE'):
            headers['content-type'] = environ['CONTENT_TYPE']
        if environ.get('CONTENT_LENGTH'):
            if environ['CONTENT_LENGTH'] == '-1':
                # This is a special case, where the content length is basically undetermined
                body = environ['wsgi.input'].read(-1)
                headers['content-length'] = str(len(body))
            else:
                headers['content-length'] = environ['CONTENT_LENGTH'] 
                length = int(environ['CONTENT_LENGTH'])
                body = environ['wsgi.input'].read(length)
        else:
            body = ''
            
        path_info = urllib.quote(environ['PATH_INFO'])
        if self.path:            
            request_path = path_info
            if request_path and request_path[0] == '/':
                request_path = request_path[1:]
                
            path = urlparse.urljoin(self.path, request_path)
        else:
            path = path_info
        if environ.get('QUERY_STRING'):
            path += '?' + environ['QUERY_STRING']
            
        conn.request(environ['REQUEST_METHOD'],
                     path,
                     body, headers)
        res = conn.getresponse()
        headers_out = parse_headers(res.msg)
        
        status = '%s %s' % (res.status, res.reason)
        start_response(status, headers_out)
        # @@: Default?
        length = res.getheader('content-length')
        if length is not None:
            body = res.read(int(length))
        else:
            body = res.read()
        conn.close()
        return [body]

def make_proxy(global_conf, address, allowed_request_methods="",
               suppress_http_headers=""):
    """
    Make a WSGI application that proxies to another address:
    
    ``address``
        the full URL ending with a trailing ``/``
        
    ``allowed_request_methods``:
        a space seperated list of request methods (e.g., ``GET POST``)
        
    ``suppress_http_headers``
        a space seperated list of http headers (lower case, without
        the leading ``http_``) that should not be passed on to target
        host
    """
    allowed_request_methods = aslist(allowed_request_methods)
    suppress_http_headers = aslist(suppress_http_headers)
    return Proxy(
        address,
        allowed_request_methods=allowed_request_methods,
        suppress_http_headers=suppress_http_headers)


class TransparentProxy(object):

    """
    A proxy that sends the request just as it was given, including
    respecting HTTP_HOST, wsgi.url_scheme, etc.

    This is a way of translating WSGI requests directly to real HTTP
    requests.  All information goes in the environment; modify it to
    modify the way the request is made.

    If you specify ``force_host`` (and optionally ``force_scheme``)
    then HTTP_HOST won't be used to determine where to connect to;
    instead a specific host will be connected to, but the ``Host``
    header in the request will remain intact.
    """

    def __init__(self, force_host=None,
                 force_scheme='http'):
        self.force_host = force_host
        self.force_scheme = force_scheme

    def __repr__(self):
        return '<%s %s force_host=%r force_scheme=%r>' % (
            self.__class__.__name__,
            hex(id(self)),
            self.force_host, self.force_scheme)

    def __call__(self, environ, start_response):
        scheme = environ['wsgi.url_scheme']
        if self.force_host is None:
            conn_scheme = scheme
        else:
            conn_scheme = self.force_scheme
        if conn_scheme == 'http':
            ConnClass = httplib.HTTPConnection
        elif conn_scheme == 'https':
            ConnClass = httplib.HTTPSConnection
        else:
            raise ValueError(
                "Unknown scheme %r" % scheme)
        if 'HTTP_HOST' not in environ:
            raise ValueError(
                "WSGI environ must contain an HTTP_HOST key")
        host = environ['HTTP_HOST']
        if self.force_host is None:
            conn_host = host
        else:
            conn_host = self.force_host
        conn = ConnClass(conn_host)
        headers = {}
        for key, value in environ.items():
            if key.startswith('HTTP_'):
                key = key[5:].lower().replace('_', '-')
                headers[key] = value
        headers['host'] = host
        if 'REMOTE_ADDR' in environ and 'HTTP_X_FORWARDED_FOR' not in environ:
            headers['x-forwarded-for'] = environ['REMOTE_ADDR']
        if environ.get('CONTENT_TYPE'):
            headers['content-type'] = environ['CONTENT_TYPE']
        if environ.get('CONTENT_LENGTH'):
            length = int(environ['CONTENT_LENGTH'])
            body = environ['wsgi.input'].read(length)
            if length == -1:
                environ['CONTENT_LENGTH'] = str(len(body))
        elif 'CONTENT_LENGTH' not in environ:
            body = ''
            length = 0
        else:
            body = ''
            length = 0
        
        path = (environ.get('SCRIPT_NAME', '')
                + environ.get('PATH_INFO', ''))
        path = urllib.quote(path)
        if 'QUERY_STRING' in environ:
            path += '?' + environ['QUERY_STRING']
        conn.request(environ['REQUEST_METHOD'],
                     path, body, headers)
        res = conn.getresponse()
        headers_out = parse_headers(res.msg)
                
        status = '%s %s' % (res.status, res.reason)
        start_response(status, headers_out)
        # @@: Default?
        length = res.getheader('content-length')
        if length is not None:
            body = res.read(int(length))
        else:
            body = res.read()
        conn.close()
        return [body]

def parse_headers(message):
    """
    Turn a Message object into a list of WSGI-style headers.
    """
    headers_out = []        
    for full_header in message.headers:
        if not full_header:            
            # Shouldn't happen, but we'll just ignore
            continue                     
        if full_header[0].isspace():
            # Continuation line, add to the last header
            if not headers_out:                        
                raise ValueError(
                    "First header starts with a space (%r)" % full_header)
            last_header, last_value = headers_out.pop()                   
            value = last_value + ' ' + full_header.strip()
            headers_out.append((last_header, value))      
            continue                                
        try:        
            header, value = full_header.split(':', 1)
        except:                                      
            raise ValueError("Invalid header: %r" % full_header)
        value = value.strip()                                   
        if header.lower() not in filtered_headers:
            headers_out.append((header, value))   
    return headers_out

def make_transparent_proxy(
    global_conf, force_host=None, force_scheme='http'):
    """
    Create a proxy that connects to a specific host, but does
    absolutely no other filtering, including the Host header.
    """
    return TransparentProxy(force_host=force_host,
                            force_scheme=force_scheme)

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
8 Jan 2025 10.42 AM
root / linksafe
0755
auth
--
25 Jul 2024 8.43 AM
root / linksafe
0755
cowbell
--
25 Jul 2024 8.43 AM
root / linksafe
0755
debug
--
25 Jul 2024 8.43 AM
root / linksafe
0755
evalexception
--
25 Jul 2024 8.43 AM
root / linksafe
0755
exceptions
--
25 Jul 2024 8.43 AM
root / linksafe
0755
util
--
25 Jul 2024 8.43 AM
root / linksafe
0755
cascade.py
4.402 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
cascade.pyc
4.314 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
cgiapp.py
9.365 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
cgiapp.pyc
8.253 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
cgitb_catcher.py
3.664 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
cgitb_catcher.pyc
3.742 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
config.py
4.211 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
config.pyc
5.151 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
errordocument.py
13.454 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
errordocument.pyc
12.721 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
fileapp.py
13.289 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
fileapp.pyc
12.932 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
fixture.py
56.633 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
fixture.py.stdlib
56.714 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
fixture.pyc
58.848 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
flup_session.py
3.849 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
flup_session.pyc
3.855 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
gzipper.py
3.605 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
gzipper.pyc
4.444 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
httpexceptions.py
23.654 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
httpexceptions.pyc
27.656 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
httpheaders.py
42.08 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
httpheaders.pyc
43.865 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
httpserver.py
54.357 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
httpserver.pyc
47.101 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
lint.py
14.647 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
lint.pyc
17.437 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
modpython.py
7.789 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
modpython.pyc
8.688 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
pony.py
2.226 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
pony.pyc
2.685 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
progress.py
7.971 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
progress.pyc
9.157 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
proxy.py
9.942 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
proxy.pyc
8.47 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
recursive.py
14.32 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
recursive.pyc
17.675 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
registry.py
21.673 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
registry.pyc
22.282 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
reloader.py
5.869 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
reloader.pyc
5.943 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
request.py
13.813 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
request.pyc
13.613 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
response.py
7.479 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
response.pyc
9.184 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
session.py
11.069 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
session.pyc
11.673 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
transaction.py
4.26 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
transaction.pyc
5.706 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
translogger.py
4.699 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
translogger.pyc
4.24 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
url.py
14.281 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
url.pyc
17.926 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
urlmap.py
8.82 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
urlmap.pyc
9.407 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
urlparser.py
25.805 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
urlparser.pyc
21.946 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
wsgilib.py
19.662 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
wsgilib.pyc
21.572 KB
22 Oct 2019 6.09 AM
root / linksafe
0644
wsgiwrappers.py
21.646 KB
21 Dec 2011 5.12 PM
root / linksafe
0644
wsgiwrappers.pyc
23.764 KB
22 Oct 2019 6.09 AM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF