Commit 435e17d9 authored by Sam Rushing's avatar Sam Rushing

new file

parent 454a125d
# -*- Mode: Python -*-
# demo an https server using OpenSSL.
import coro
import coro.http
import coro.backdoor
from coro.ssl import openssl
ctx = coro.ssl.new_ctx (
cert = openssl.x509 (open('../cert/server.crt').read()),
key = openssl.pkey (open('../cert/server.key').read(), private=True),
)
server = coro.http.openssl_server (ctx)
server.push_handler (coro.http.handlers.coro_status_handler())
server.push_handler (coro.http.handlers.favicon_handler())
coro.spawn (server.start, ('0.0.0.0', 9443))
coro.spawn (coro.backdoor.serve, unix_path='/tmp/https.bd')
coro.event_loop (30.0)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment