示例#1
0
 def test_create_url09(self):
     self.assertEqual(
         createWsUrl("localhost",
                     isSecure=True,
                     port=9090,
                     path="ws",
                     params={'foo': 'bar'}),
         "wss://localhost:9090/ws?foo=bar")
示例#2
0
 def test_create_url10(self):
     wsurl = createWsUrl("localhost",
                         isSecure=True,
                         port=9090,
                         path="ws",
                         params={
                             'foo': 'bar',
                             'moo': 23
                         })
     self.assertTrue(wsurl == "wss://localhost:9090/ws?foo=bar&moo=23"
                     or wsurl == "wss://localhost:9090/ws?moo=23&foo=bar")
示例#3
0
def main(listen_addr='127.0.0.1',
         port=8947,
         gpsdws_www_root=DEFAULT_GPSDWS_ROOT,
         cert=DEFAULT_CERT):
    # Load server certificate
    certData = open(DEFAULT_CERT, 'rb').read()
    certificate = ssl.PrivateCertificate.loadPEM(certData)

    # Create server
    uri = createWsUrl(listen_addr, port)
    site = GPSdWSSite(uri, gpsdws_www_root)
    reactor.listenSSL(port, site, certificate.options(), interface=listen_addr)
示例#4
0
 def test_create_url05(self):
     self.assertEqual(createWsUrl("localhost", path="/ws/foobar"),
                      "ws://localhost:80/ws/foobar")
示例#5
0
 def test_create_url02(self):
     self.assertEqual(createWsUrl("localhost", port=8090),
                      "ws://localhost:8090/")
示例#6
0
 def test_create_url03(self):
     self.assertEqual(createWsUrl("localhost", path="ws"),
                      "ws://localhost:80/ws")
示例#7
0
 def test_create_url15(self):
     self.assertEqual(createWsUrl("0:0:0:0:0:0:0:1", path="ws"),
                      "ws://0:0:0:0:0:0:0:1:80/ws")
示例#8
0
 def test_create_url01(self):
     self.assertEqual(createWsUrl("localhost"), "ws://localhost:80/")
示例#9
0
 def test_create_url02(self):
    self.assertEqual(createWsUrl("localhost", port = 8090), "ws://localhost:8090/")
示例#10
0
 def test_create_url05(self):
    self.assertEqual(createWsUrl("localhost", path = "/ws/foobar"), "ws://localhost:80/ws/foobar")
示例#11
0
 def test_create_url12(self):
    self.assertEqual(createWsUrl("62.146.25.34", path = "ws"), "ws://62.146.25.34:80/ws")
示例#12
0
 def test_create_url11(self):
     self.assertEqual(createWsUrl("127.0.0.1", path="ws"),
                      "ws://127.0.0.1:80/ws")
示例#13
0
 def test_create_url10(self):
    wsurl = createWsUrl("localhost", isSecure = True, port = 9090, path = "ws", params = {'foo': 'bar', 'moo': 23})
    self.assertTrue(wsurl == "wss://localhost:9090/ws?foo=bar&moo=23" or wsurl == "wss://localhost:9090/ws?moo=23&foo=bar")
示例#14
0
 def test_create_url11(self):
    self.assertEqual(createWsUrl("127.0.0.1", path = "ws"), "ws://127.0.0.1:80/ws")
示例#15
0
 def test_create_url09(self):
    self.assertEqual(createWsUrl("localhost", isSecure = True, port = 9090, path = "ws", params = {'foo': 'bar'}), "wss://localhost:9090/ws?foo=bar")
示例#16
0
 def test_create_url08(self):
    self.assertEqual(createWsUrl("localhost", isSecure = True, port = 80), "wss://localhost:80/")
示例#17
0
 def test_create_url07(self):
    self.assertEqual(createWsUrl("localhost", isSecure = True, port = 443), "wss://localhost:443/")
示例#18
0
 def test_create_url07(self):
     self.assertEqual(createWsUrl("localhost", isSecure=True, port=443),
                      "wss://localhost:443/")
示例#19
0
 def test_create_url13(self):
     self.assertEqual(createWsUrl("subsub1.sub1.something.com", path="ws"),
                      "ws://subsub1.sub1.something.com:80/ws")
示例#20
0
 def test_create_url08(self):
     self.assertEqual(createWsUrl("localhost", isSecure=True, port=80),
                      "wss://localhost:80/")
示例#21
0
 def test_create_url01(self):
    self.assertEqual(createWsUrl("localhost"), "ws://localhost:80/")
示例#22
0
 def test_create_url13(self):
    self.assertEqual(createWsUrl("subsub1.sub1.something.com", path = "ws"), "ws://subsub1.sub1.something.com:80/ws")
示例#23
0
 def test_create_url03(self):
    self.assertEqual(createWsUrl("localhost", path = "ws"), "ws://localhost:80/ws")
示例#24
0
 def test_create_url12(self):
     self.assertEqual(createWsUrl("62.146.25.34", path="ws"),
                      "ws://62.146.25.34:80/ws")
示例#25
0
 def test_create_url14(self):
    self.assertEqual(createWsUrl("::1", path = "ws"), "ws://::1:80/ws")
示例#26
0
 def test_create_url14(self):
     self.assertEqual(createWsUrl("::1", path="ws"), "ws://::1:80/ws")
示例#27
0
 def test_create_url15(self):
    self.assertEqual(createWsUrl("0:0:0:0:0:0:0:1", path = "ws"), "ws://0:0:0:0:0:0:0:1:80/ws")