Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webserver and Websocket at same port , Serving pages gets timed OUT #3237

Open
Somritag opened this issue Oct 3, 2024 · 6 comments
Open

Comments

@Somritag
Copy link

Somritag commented Oct 3, 2024

Hi Andy,

Am using HTTPS and WSS both at port 443,

image

My issue is when am having two pvo : lws-minimal-server-echo, default (snippet above) I can use both webserver and websocket
but while serving WEB pages getting ERR_CONNECTION_CLOSED after loading few files
image

If I keep only one pvo for the websocket callback,

The webserver load performance is stable but the websocket connection gets open but SEND/RECEIVE does not happen (testing with simple web client)

Creating context as below:
image

Protocols defined looks like this:
image

Any guidance will help.
Thanks

@lws-team
Copy link
Member

lws-team commented Oct 4, 2024

... lws send out a lot of logs you can use to understand its point of view. You're going to have to look at them...

The commented pvo's job is to tell lws how to route a NULL protocol name request for ws upgrade, in terms of which protocol on the lws side. If the browser side doesn't provide a protocol name with its request, you need to use it to bind the ws connection to the expected protocol / callback.

@Somritag
Copy link
Author

Hi Andy,

Is there a better approach to handle webServer and websocket using same port 443 with FreeRTOS and STM32/ any example with FREERTOS multi threading to handle webserver/ websocket?
Will timer callback for websocket help ? or separate ports for server and websocket will help??
At present am getting ERR_CONECTION_CLOSED after approx 1 mnt of serving bigger files.
If websocket is not listening to same port files loading is all fine.

@lws-team
Copy link
Member

logs...

@Somritag
Copy link
Author

Somritag commented Oct 14, 2024

Attaching the logs..
webserver_loading.txt
webserver_websocket_loding.txt

looks like this... when not loaded completely
image

@lws-team
Copy link
Member

lws_h2_goaway: [wsisrv|4|adopted|h1|h2]: ERR 0x1, 'Another stream not allowed'

Does this help?

diff --git a/lib/plat/freertos/freertos-init.c b/lib/plat/freertos/freertos-init.c
index 49f5b5d9..15f0916d 100644
--- a/lib/plat/freertos/freertos-init.c
+++ b/lib/plat/freertos/freertos-init.c
@@ -60,7 +60,7 @@ const struct http2_settings lws_h2_defaults_esp32 = { {
        1,
        /* H2SET_HEADER_TABLE_SIZE */                    512,
        /* H2SET_ENABLE_PUSH */                            0,
-       /* H2SET_MAX_CONCURRENT_STREAMS */                 8,
+       /* H2SET_MAX_CONCURRENT_STREAMS */                 16,
        /* H2SET_INITIAL_WINDOW_SIZE */                    0,
        /* H2SET_MAX_FRAME_SIZE */                     16384,
        /* H2SET_MAX_HEADER_LIST_SIZE */                 512,

@Somritag
Copy link
Author

This did not help, still having same issue.
image
Firefox capture... and wire shark...
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants