• [^] # Re: mon serveur web ipv6 perso

    Posté par . En réponse au journal ohio, le web facile. Évalué à 3.


    $ cat test.py
    import SocketServer, BaseHTTPServer, SimpleHTTPServer, signal, sys, socket
    class MyHTTPServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
    address_family = getattr(socket, 'AF_INET6', None)

    SimpleHTTPServer.test(ServerClass=MyHTTPServer)
    $ python test.py
    Serving HTTP on :: port 8000 ...
    localhost - - [05/Aug/2007 15:48:02] "GET / HTTP/1.0" 200 -



    $ curl http://localhost:8000/
    [title>Directory listing for /[/title>
    [h2>Directory listing for /[/h2>
    [hr>
    [ul>
    [li>[a href=".AbiSuite/">.AbiSuite/[/a>
    [li>[a href=".acidriprc">.acidriprc[/a>
    [...]
    [li>[a href="%E2%96%92%E2%94%B4/">▒┴/[/a>
    [/ul>
    [hr>


    Ca me donne envie d'apprendre à écrire en python ...