!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.16 (Debian). PHP/5.3.3-7+squeeze19 

uname -a: Linux mail.tri-specialutilitydistrict.com 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC
2014 x86_64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/doc/python-twisted-web/howto/web-in-60/   drwxr-xr-x
Free 129.71 GB of 142.11 GB (91.27%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     static-content.html (5.97 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
Twisted Documentation: Serving Static Content From a Directory

Serving Static Content From a Directory

    The goal of this example is to show you how to serve static content from a filesystem. First, we need to import some objects:

    • Site, an IProtocolFactory which glues a listening server port (IListeningPort) to the HTTPChannel implementation:

      1

      from twisted.web.server import Site
    • File, an IResource which glues the HTTP protocol implementation to the filesystem:

      1

      from twisted.web.static import File
    • The reactor, which drives the whole process, actually accepting TCP connections and moving bytes into and out of them:

      1

      from twisted.internet import reactor
    Next, we create an instance of the File resource pointed at the directory to serve:

    1

    resource = File("/tmp")
    Then we create an instance of the Site factory with that resource:

    1

    factory = Site(resource)
    Now we glue that factory to a TCP port:

    1

    reactor.listenTCP(8888, factory)
    Finally, we start the reactor so it can make the program work:

    1

    reactor.run()
    And that's it. Here's the complete program:

    1 2 3 4 5 6 7 8

    from twisted.web.server import Site from twisted.web.static import File from twisted.internet import reactor resource = File('/tmp') factory = Site(resource) reactor.listenTCP(8888, factory) reactor.run()

    Bonus example! For those times when you don't actually want to write a new program, the above implemented functionality is one of the things the command line twistd tool can do. In this case, the command

    twistd -n web --path /tmp
    
    will accomplish the same thing as the above server. See helper programs in the Twisted Core documentation for more information on using twistd.

    Index

    Version: 10.1.0

    :: Command execute ::

    Enter:
     
    Select:
     

    :: Search ::
      - regexp 

    :: Upload ::
     
    [ Read-Only ]

    :: Make Dir ::
     
    [ Read-Only ]
    :: Make File ::
     
    [ Read-Only ]

    :: Go Dir ::
     
    :: Go File ::
     

    --[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0081 ]--