Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
73f2602b
Commit
73f2602b
authored
Aug 26, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated due to ssl_wrapper.h refactoring
parent
44561d16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
ws_ssl.c
examples/ws_ssl/ws_ssl.c
+7
-9
No files found.
examples/ws_ssl/ws_ssl.c
View file @
73f2602b
...
@@ -21,12 +21,10 @@ struct config {
...
@@ -21,12 +21,10 @@ struct config {
};
};
static
struct
config
s_wrappers
[]
=
{
static
struct
config
s_wrappers
[]
=
{
{
"ws1"
,
{
"127.0.0.1"
,
9001
,
0
,
NULL
,
"7001"
,
NULL
,
NULL
,
NULL
,
""
}},
{
"ws1"
,
{
"127.0.0.1"
,
9001
,
0
,
0
,
0
,
""
,
"7001"
,
0
,
0
}},
{
"ws1"
,
{
"127.0.0.1"
,
9001
,
0
,
NULL
,
"7002"
,
"certs/ws1_server.pem"
,
{
"ws1"
,
{
"127.0.0.1"
,
9001
,
0
,
0
,
0
,
""
,
"7002"
,
"certs/ws1_server.pem"
,
0
}},
NULL
,
NULL
,
""
}},
{
"ws2"
,
{
"127.0.0.1"
,
9002
,
1
,
0
,
0
,
""
,
"7003"
,
0
,
0
}},
{
"ws2"
,
{
"127.0.0.1"
,
9002
,
1
,
NULL
,
"7003"
,
NULL
,
NULL
,
NULL
,
""
}},
{
"ws2"
,
{
"127.0.0.1"
,
9002
,
1
,
0
,
0
,
""
,
"7004"
,
"certs/ws2_server.pem"
,
0
}}
{
"ws2"
,
{
"127.0.0.1"
,
9002
,
1
,
NULL
,
"7004"
,
"certs/ws2_server.pem"
,
NULL
,
NULL
,
""
}}
};
};
static
int
s_received_signal
=
0
;
static
int
s_received_signal
=
0
;
...
@@ -45,7 +43,7 @@ static int ev_handler(struct mg_connection *conn, enum mg_event ev) {
...
@@ -45,7 +43,7 @@ static int ev_handler(struct mg_connection *conn, enum mg_event ev) {
if
(
strcmp
(
conn
->
request_method
,
"CONNECT"
)
==
0
)
{
if
(
strcmp
(
conn
->
request_method
,
"CONNECT"
)
==
0
)
{
char
host
[
1025
]
=
""
;
char
host
[
1025
]
=
""
;
int
i
,
is_ssl
,
port
=
0
;
int
i
,
is_ssl
,
port
=
0
;
sscanf
(
conn
->
uri
,
"%1024[^:]:%d"
,
host
,
&
port
);
sscanf
(
conn
->
uri
,
"%1024[^:]:%d"
,
host
,
&
port
);
is_ssl
=
(
port
==
443
?
1
:
0
);
is_ssl
=
(
port
==
443
?
1
:
0
);
...
@@ -138,7 +136,7 @@ int main(void) {
...
@@ -138,7 +136,7 @@ int main(void) {
// Setup signal handlers
// Setup signal handlers
signal
(
SIGTERM
,
signal_handler
);
signal
(
SIGTERM
,
signal_handler
);
signal
(
SIGINT
,
signal_handler
);
signal
(
SIGINT
,
signal_handler
);
// Start SSL wrappers, each in it's own thread
// Start SSL wrappers, each in it's own thread
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
s_wrappers
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
s_wrappers
);
i
++
)
{
ns_start_thread
(
wrapper_thread_func
,
&
s_wrappers
[
i
]);
ns_start_thread
(
wrapper_thread_func
,
&
s_wrappers
[
i
]);
...
@@ -147,7 +145,7 @@ int main(void) {
...
@@ -147,7 +145,7 @@ int main(void) {
// Start websocket servers in separate threads
// Start websocket servers in separate threads
mg_start_thread
(
serve_thread_func
,
ws1_server
);
mg_start_thread
(
serve_thread_func
,
ws1_server
);
mg_start_thread
(
serve_thread_func
,
ws2_server
);
mg_start_thread
(
serve_thread_func
,
ws2_server
);
// Finally, start proxy server in this thread: this call blocks
// Finally, start proxy server in this thread: this call blocks
serve_thread_func
(
proxy_server
);
serve_thread_func
(
proxy_server
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment