-
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
websocket client with SSL problem: Server replied to me "Bad Request" #487
Comments
Can you add |
parameters: -logtostdout true -url https://stream.bybit.com/v5/public/spot -v 4 -http_client_connect_timeout 3000 code: log: what happened for this bad MASK? |
I guess proxygen has nothing of the opcode and mask in the websocket codec? I can see only the 3 simple upgrade handling functions there. |
The websocket codec can be layered on top of proxygen in onBody calls. We have an internal implementation that isn't open source - maybe we move it over? Any interest in WebTransport - it's the new hotness: https://github.com/facebook/proxygen/blob/main/proxygen/lib/http/webtransport/WebTransport.h |
For our hedge fund, we focus on clients for connection. if the server side requires websocket, we have to do with it, even if webTransport is better. So would you consider about moving the websocket codec into proxygen? cpprestsdk is using websocketpp, but that framework does not support http2. proxygen+folly is much better if the websocket codec is supported, I think more teams/funds who are using c++ will move to proxygen. (Although most developers prefer go/rust/python for clients, they are much easier for designing business logic) |
I tried to write the websocket client with SSL according to the example of the websocket example. The SSL part is OK, so I skip talking about it.
Here is the code:
void WebSocketClient::setupRequest() {
request_.setMethod(HTTPMethod::GET);
request_.setHTTPVersion(1, 1);
request_.setURL("wss://stream.bybit.com/v5/public/spot");
request_.getHeaders().add(HTTP_HEADER_USER_AGENT, "proxygen_websocket_client");
request_.getHeaders().add(HTTP_HEADER_HOST, "stream.bybit.com:443");
request_.getHeaders().add("Accept", "/");
request_.setEgressWebsocketUpgrade();
LOG(INFO) << request_;
}
I got the onBody callback tell me "Bad Request", and I had tried on other websocket like wss://api.gateio.ws/ws/v4/, they return me the same "Bad Request"
I run them with -url https://stream.bybit.com/v5/public/spot
any idea about how to connect on them correctly?
The text was updated successfully, but these errors were encountered: