Added very basic WebSocket support to json server

Why are these variables declared here? They should be declared in the narrowest scope.