File tree Expand file tree Collapse file tree 6 files changed +450
-0
lines changed
samples/net/sockets/websocket_client Expand file tree Collapse file tree 6 files changed +450
-0
lines changed Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0
2+
3+ cmake_minimum_required (VERSION 3.13.1)
4+ include ($ENV{ZEPHYR_BASE} /cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
5+ project (http_client)
6+
7+ FILE (GLOB app_sources src/*.c)
8+ target_sources (app PRIVATE ${app_sources} )
9+
10+ set (gen_dir ${ZEPHYR_BINARY_DIR} /include /generated /)
11+
12+ generate_inc_file_for_target(
13+ app
14+ src/echo-apps-cert.der
15+ ${gen_dir} /echo-apps-cert.der.inc
16+ )
Original file line number Diff line number Diff line change 1+ # Networking config
2+ CONFIG_NETWORKING=y
3+ CONFIG_NET_IPV4=y
4+ CONFIG_NET_IPV6=y
5+ CONFIG_NET_TCP=y
6+ CONFIG_NET_SHELL=y
7+ CONFIG_NET_STATISTICS=y
8+
9+ # Sockets
10+ CONFIG_NET_SOCKETS=y
11+ CONFIG_NET_SOCKETS_POSIX_NAMES=y
12+ CONFIG_NET_SOCKETS_POLL_MAX=4
13+
14+ # Network driver config
15+ CONFIG_TEST_RANDOM_GENERATOR=y
16+
17+ # Network address config
18+ CONFIG_NET_CONFIG_SETTINGS=y
19+ CONFIG_NET_CONFIG_NEED_IPV4=y
20+ CONFIG_NET_CONFIG_NEED_IPV6=y
21+ CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1"
22+ CONFIG_NET_CONFIG_MY_IPV4_GW="192.0.2.2"
23+ # Address of HTTP IPv4 server
24+ CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2"
25+ CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1"
26+ # Address of HTTP IPv6 server
27+ CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2"
28+
29+ # HTTP & Websocket
30+ CONFIG_HTTP_CLIENT=y
31+ CONFIG_WEBSOCKET_CLIENT=y
32+
33+ # Network debug config
34+ CONFIG_LOG=y
35+ CONFIG_LOG_IMMEDIATE=y
36+ CONFIG_NET_LOG=y
37+ #CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y
38+ #CONFIG_NET_HTTP_LOG_LEVEL_DBG=y
39+ #CONFIG_NET_WEBSOCKET_LOG_LEVEL_DBG=y
40+ #CONFIG_NET_CONTEXT_LOG_LEVEL_DBG=y
41+ #CONFIG_NET_TCP_LOG_LEVEL_DBG=y
42+
43+ CONFIG_MAIN_STACK_SIZE=2048
44+ CONFIG_HEAP_MEM_POOL_SIZE=1500
Original file line number Diff line number Diff line change 1+ common :
2+ tags : net http http_client websocket_client
3+ sample :
4+ description : Websocket client sample
5+ name : websocket_client
6+ tests :
7+ sample.net.sockets.websocket_client :
8+ harness : net
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2019 Intel Corporation
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ #define CA_CERTIFICATE_TAG 1
8+
9+ #define TLS_PEER_HOSTNAME "localhost"
10+
11+ /* This is the same cert as what is found in net-tools/echo-apps-cert.pem file
12+ */
13+ static const unsigned char ca_certificate [] = {
14+ #include "echo-apps-cert.der.inc"
15+ };
You can’t perform that action at this time.
0 commit comments