Initial webserver implementation, plus organized directory structure a bit better

This commit is contained in:
byt3bl33d3r 2015-05-19 22:43:43 +02:00
parent fb26d89204
commit 929520fcc8
27 changed files with 54 additions and 240 deletions

18
plugins/TestPlugin.py Normal file
View file

@ -0,0 +1,18 @@
from plugins.plugin import Plugin
from core.servers.http.HTTPServer import HTTPServer
import tornado.web
class TestPlugin(Plugin):
name = "testplugin"
optname = "test"
desc = "Plugin to test dynamically configuring the internal web server"
version = "0.1"
has_opts = False
def initialize(self, options):
HTTPServer.getInstance().application.add_handlers('', [(r"/test", MainHandler)])
class MainHandler(tornado.web.RequestHandler):
def get(self):
print self.request
self.write("Hello World!")