-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
trying to connect to server on wss protocol using libwebsockets #3333
Comments
ccinfo.path is not a url. It's just the path part, probably, "trade/s" in your case. If example.com has real certs for its https server, you do not want ALLOW_SELFSIGNED or SKIP_SERVER_CERT_HOSTNAME_CHECK either. |
Thank you, tried this one but still getting the same error, here my logs after importing certs [2025/02/08 13:06:23:3063] D: _realloc: size 72: client ctx tcr |
It even gets into my callback to LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER and sets the headers I've set but still getting 502 |
... ultimately it's up to the server to choose if it likes what you sent or not, it's not up to lws. A good trick is set |
Sorry, my bad. The server uses socket-io server and after reading some issues about it I fount our that I need to do some stuff before, thanks |
I've tried using JavaScript to connect to websocket server on "wss://example.com/trade/s/
But now I am trying to rewrite it to C using libwebsockets, my code is:
static struct lws_protocols protocols[] = {
{ "ws-protocols", callback_websocket, 0, 4096 }
};
int initWebSocket() {
}
But i keep getting 502 bad gateway.. I dont really get the difference between address, path, host, oorigin but I tried my best to find any info on the internet, also tried path: /trade/s/
The text was updated successfully, but these errors were encountered: