Похожие чаты

Hello! I’m using the gorilla/websocket pkg and want to make

WS -> TCP proxy. I do conn.ReadMessage() in the websocket connection loop and then I send it to the TCP server I connected to earlier, then I take the response from the TCP server and send it back. It seems to be simple.

ws -> tcp
ws <- tcp

But the problem is that I read, then send, then read the response and send back. If a message conditionally weighs 100 MB, then I will read 100 MB first and then send it back.

Can I read those 100 MB from the websockets over TCP frames and send them out immediately or something like that? Or which way should I think?

2 ответов

28 просмотров
cryshado- Автор вопроса

I think it can copy a lot of unnecessary data, such as HTTP headers ws connection. And won't it work in a similar way, i.e., it first waits for a full message from firstWebSocketConn, and then sends to secondTCPConn?

cryshado
I think it can copy a lot of unnecessary data, suc...

In raw TCP there are no full messages AFAIK. Unless you add metadata, like HTTP & Websockets

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта