Skip to content

Commit ba9e55e

Browse files
update websocket examples
1 parent 2f0546e commit ba9e55e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

draft_code/modwebsocket_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
port = 443
1010
handshake_path = '/raw'
1111
# Option: echo.websocket.events (unreliable)
12-
# host = 'echo.websocket.events'
13-
# handshake_path = '/'
12+
#host = 'echo.websocket.events'
13+
#handshake_path = '/'
1414

1515
try:
1616
addr_info = socket.getaddrinfo(host, port)[0][-1]

internal_filesystem/apps/com.example.btcticker/assets/echo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
try:
1616
URL = sys.argv[1] # expects a websocket echo server
1717
except Exception:
18-
URL = "ws://echo.websocket.events"
18+
# URL = "ws://echo.websocket.events" # also works
19+
URL = "wss://echo.websocket.events"
1920

2021

2122
sslctx = False
@@ -24,6 +25,7 @@
2425
try:
2526
sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
2627
sslctx.verify_mode = ssl.CERT_NONE
28+
#sslctx.verify_mode = ssl.CERT_REQUIRED # doesn't work because OSError: (-30336, 'MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED')
2729
except Exception:
2830
pass
2931

0 commit comments

Comments
 (0)