make websocket a library, fix debug page.