Created
October 3, 2018 20:04
-
-
Save davidblewett/1d9ad0f09274ad4adf8d7b6c403622ac to your computer and use it in GitHub Desktop.
Tornado TCP Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7 | |
RUN mkdir /app | |
COPY . /app | |
RUN apt-get update && \ | |
apt-get install -y netcat && \ | |
pip install Tornado |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ssl | |
import subprocess | |
import tornado.web | |
ssl_ctx = ssl.create_default_context() | |
ssl_ctx.check_hostname = False | |
app = tornado.web.Application() | |
app.listen(8888, ssl_options=ssl_ctx) | |
loop = tornado.ioloop.IOLoop.current() | |
loop.spawn_callback(subprocess.run, ['nc', '-vz', '127.0.0.1', '8888']) | |
loop.call_later(1, loop.stop) | |
loop.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment