mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-24 07:47:30 +02:00
websocket: updated example to use local websocket echo server
This commit is contained in:
@ -101,7 +101,7 @@ def test_examples_protocol_websocket(dut):
|
||||
data = json.loads(json_string)
|
||||
|
||||
match = dut.expect(
|
||||
re.compile(b'Json=([a-zA-Z0-9]*).*')).group(0).decode()[5:]
|
||||
re.compile(b'Json=({[a-zA-Z0-9]*).*}')).group(0).decode()[5:]
|
||||
if match == str(data[0]):
|
||||
print('Sent message and received message are equal')
|
||||
else:
|
||||
@ -122,7 +122,7 @@ def test_examples_protocol_websocket(dut):
|
||||
recv_msg = ''
|
||||
while len(recv_msg) < msg_len:
|
||||
match = dut.expect(re.compile(
|
||||
b'Received=([a-zA-Z0-9]*).*')).group(1).decode()
|
||||
b'Received=([a-zA-Z0-9]*).*\n')).group(1).decode()
|
||||
recv_msg += match
|
||||
|
||||
if recv_msg == send_msg:
|
||||
|
@ -1,6 +1,5 @@
|
||||
CONFIG_WEBSOCKET_URI_FROM_STDIN=n
|
||||
CONFIG_WEBSOCKET_URI_FROM_STRING=y
|
||||
CONFIG_WEBSOCKET_URI="ws://echo.websocket.events"
|
||||
CONFIG_WEBSOCKET_URI_FROM_STDIN=y
|
||||
CONFIG_WEBSOCKET_URI_FROM_STRING=n
|
||||
CONFIG_EXAMPLE_CONNECT_ETHERNET=y
|
||||
CONFIG_EXAMPLE_CONNECT_WIFI=n
|
||||
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
|
||||
|
Reference in New Issue
Block a user