from simplewebframework.server.server import Server
from demoapp.hello import Hello
from demoapp.hello_filter import HelloFilter
from demoapp import web
import inspect

# sampleApp
if __name__ == "__main__":
    # Without SSL
    s = Server(8282)
    # With SSL
    # s = Server(4343, ssl=True, cert="path/to/base64 encoded cert", key="path/to/private key")
    s.register(inspect.getfile(web))
    s.register(HelloFilter())
    s.register(Hello())  # register a worker here
    s.run()
from simplewebframework.server.server import Server
from simplewebframework.framework.websocket import WSWorker


class test_worker(WSWorker):
    def __init__(self):
        super(test_worker, self).__init__("/*")

    def connected(self, webroot, req):
        pass

# sampleApp
if __name__ == "__main__":
    # Without SSL
    s = Server(8282)
    s.register(test_worker())  # register a worker here
    s.run()