Commit 3a430b44 authored by Yury's avatar Yury

allow custom port, host in config

now server is non-blocking
parent 096f2e7d
Pipeline #71 passed with stages
in 9 minutes and 47 seconds
......@@ -3,13 +3,15 @@ from .protocol import Protocol
class Connection:
def __init__(self, dispatcher_cls, loop, cert_path, key_path, prefix='dns-request'):
def __init__(self, dispatcher_cls, loop, cert_path, key_path, prefix='dns-request', host='0.0.0.0', port=443):
self.dispatcher_cls = dispatcher_cls
self.loop = loop
self.cert_path = cert_path
self.key_path = key_path
self.prefix = prefix
self.host = host
self.port = port
async def start(self):
print('Starting DNS-over-HTTPS server')
Protocol(self).start()
\ No newline at end of file
await Protocol(self).start()
\ No newline at end of file
......@@ -22,5 +22,5 @@ class Protocol:
pass
return web.Response(text='1234')
def start(self):
web.run_app(self.app)
\ No newline at end of file
async def start(self):
await web._run_app(self.app, port=self.connector.port, host=self.connector.host)
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