Giter Site home page Giter Site logo

Comments (5)

afrind avatar afrind commented on May 20, 2024

Can you add -v 4 and paste the log here? I suspect it may not like your wss:// URL scheme but not sure.

from proxygen.

Long199for avatar Long199for commented on May 20, 2024

parameters: -logtostdout true -url https://stream.bybit.com/v5/public/spot -v 4 -http_client_connect_timeout 3000

code:
void WebSocketClient::setupRequest() {
request_.setMethod(HTTPMethod::GET);
request_.setHTTPVersion(1, 1);
request_.setURL(url_.getPath());
request_.getHeaders().add(HTTP_HEADER_USER_AGENT, "proxygen_websocket_client");
request_.getHeaders().add(HTTP_HEADER_HOST, url_.getHostAndPort());
request_.getHeaders().add("Sec-Websocket-Version", "13"); // add this, or failed to connect
request_.getHeaders().add("Accept", "/");
request_.setEgressWebsocketUpgrade();
LOG(INFO) << request_;
}

log:
I20240308 11:32:51.890995 35495345 WebSocketClient.cpp:108] websocket connect successful; sending data
I20240308 11:32:51.891044 35495345 HTTPSessionBase.cpp:159] notifyEgressBodyBuffered pwsd=34
I20240308 11:32:51.891105 35495345 HTTPSession.cpp:2166] proto=http/1.1, local=[2606:4700:110:833d:9c7b:de39:ccc0:aa39]:63013, [2600:9000:24bb:6800:17:57ca:2ec0:93a1]:443=upstream egressing txnID=1 allowed=65536
I20240308 11:32:51.891148 35495345 HTTPTransaction.cpp:1310] Sending 34 bytes of body. eom=no send_window is None trailers=no proto=http/1.1, local=[2606:4700:110:833d:9c7b:de39:ccc0:aa39]:63013, [2600:9000:24bb:6800:17:57ca:2ec0:93a1]:443=upstream, streamID=1
I20240308 11:32:51.891187 35495345 HTTPSessionBase.cpp:159] notifyEgressBodyBuffered pwsd=-34
I20240308 11:32:51.891227 35495345 HTTPSession.cpp:2274] proto=http/1.1, local=[2606:4700:110:833d:9c7b:de39:ccc0:aa39]:63013, [2600:9000:24bb:6800:17:57ca:2ec0:93a1]:443=upstream writing 34, activeWrites=1 cork:0 timestampTx:0 timestampAck:0
I20240308 11:32:52.242440 35495345 AsyncSSLSocket.cpp:1519] AsyncSSLSocket::performReadSingle() this=0x14a820c00, buf=0x14d008200, buflen=4000
I20240308 11:32:52.242612 35495345 AsyncSocket.cpp:3169] this=0x14a820c00, AsyncSocket::handleRead() got 56 bytes
I20240308 11:32:52.242681 35495345 HTTPSessionBase.cpp:148] proto=http/1.1, local=[2606:4700:110:833d:9c7b:de39:ccc0:aa39]:63013, [2600:9000:24bb:6800:17:57ca:2ec0:93a1]:443=upstream Dequeued 56 bytes of ingress. Ingress buffer uses 0 of 65536 bytes.
I20240308 11:32:52.242735 35495345 WebSocketClient.cpp:101] got server reply: �6�RSV1 set, RSV2 set, RSV3 set, bad opcode 7, bad MASK
I20240308 11:32:52.242799 35495345 AsyncSSLSocket.cpp:1519] AsyncSSLSocket::performReadSingle() this=0x14a820c00, buf=0x14d008200, buflen=4000
I20240308 11:32:52.242848 35495345 AsyncSocket.cpp:3169] this=0x14a820c00, AsyncSocket::handleRead() got 0 bytes
I20240308 11:32:52.242880 35495345 HTTPSession.cpp:558] EOF on proto=http/1.1, local=[2606:4700:110:833d:9c7b:de39:ccc0:aa39]:63013, [2600:9000:24bb:6800:17:57ca:2ec0:93a1]:443=upstream
I20240308 11:32:52.242915 35495345 HTTPSession.cpp:2337] shutdown request for proto=http/1.1, local=[2606:4700:110:833d:9c7b:de39:ccc0:aa39]:63013, [2600:9000:24bb:6800:17:57ca:2ec0:93a1]:443=upstream: reads=1 (currently 0), writes=0 (currently 0)

what happened for this bad MASK?

from proxygen.

Long199for avatar Long199for commented on May 20, 2024

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.
It's far away from the real world.

from proxygen.

afrind avatar afrind commented on May 20, 2024

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

from proxygen.

Long199for avatar Long199for commented on May 20, 2024

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)

from proxygen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.