test query parameters
This commit is contained in:
@@ -21,6 +21,8 @@ __all__ = ("WebSocketResource",
|
|||||||
"WSGIRootResource",)
|
"WSGIRootResource",)
|
||||||
|
|
||||||
|
|
||||||
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
|
|
||||||
from twisted.protocols.policies import ProtocolWrapper
|
from twisted.protocols.policies import ProtocolWrapper
|
||||||
|
|||||||
2
examples/twisted/websocket/echo_site/Makefile
Normal file
2
examples/twisted/websocket/echo_site/Makefile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
test:
|
||||||
|
PYTHONPATH=../../../../autobahn python server.py
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
var wsuri;
|
var wsuri;
|
||||||
if (window.location.protocol === "file:") {
|
if (window.location.protocol === "file:") {
|
||||||
wsuri = "ws://127.0.0.1:8080/ws";
|
wsuri = "ws://127.0.0.1:8080/ws?a=23&foo=bar";
|
||||||
} else {
|
} else {
|
||||||
wsuri = "ws://" + window.location.hostname + ":8080/ws";
|
wsuri = "ws://" + window.location.hostname + ":8080/ws";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,10 +32,14 @@ from autobahn.twisted.resource import WebSocketResource, \
|
|||||||
|
|
||||||
class EchoServerProtocol(WebSocketServerProtocol):
|
class EchoServerProtocol(WebSocketServerProtocol):
|
||||||
|
|
||||||
|
def onConnect(self, request):
|
||||||
|
print("WebSocket connection request: {}".format(request))
|
||||||
|
|
||||||
def onMessage(self, payload, isBinary):
|
def onMessage(self, payload, isBinary):
|
||||||
self.sendMessage(payload, isBinary)
|
self.sendMessage(payload, isBinary)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
if len(sys.argv) > 1 and sys.argv[1] == 'debug':
|
if len(sys.argv) > 1 and sys.argv[1] == 'debug':
|
||||||
|
|||||||
Reference in New Issue
Block a user