25 lines
573 B
Python
25 lines
573 B
Python
# -*- coding: utf-8 -*-
|
|
import os
|
|
import tornado.ioloop
|
|
import tornado.web
|
|
import tornado.websocket
|
|
|
|
class ChatSocketHandler(tornado.websocket.WebSocketHandler):
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
class ServerSide:
|
|
|
|
def __init__(self, local_port, remote_port):
|
|
self._local_port = local_port
|
|
self._remote_port = remote_port
|
|
|
|
def run(self):
|
|
settings = {}
|
|
app = tornado.web.Application([
|
|
(r"/websocket", ChatSocketHandler)
|
|
], **settings)
|
|
app.listen(8181)
|
|
tornado.ioloop.IOLoop.instance().start()
|