added websocket support. improvement: based on twisted application framework