justcoding121 / titanium-web-proxy

A cross-platform asynchronous HTTP(S) proxy server in C#.
MIT License
1.93k stars 618 forks source link

How to handle WebSocket request #925

Open CosmoShang opened 2 years ago

CosmoShang commented 2 years ago

I wrote a proxy in python for one of my previous projects. The proxy filters and blocks a piece of websocket plaintext sent by the client to the server. The proxy resends the previously intercepted plaintext to the server at the appropriate time(maybe 10 seconds later). It looks like the client just sent a websocket data to the server.

But in the Titanium-web-proxy example, I only found the following two events. (e.DataSent += WebSocket_DataSent;e.DataReceived += WebSocket_DataReceived;)

My questions are: 1 Can Titanium-web-proxy implement the functions I mentioned above? 2 If Titanium-web-proxy does not implement the above functions,Is there a sample implemented under C#?

Would love for any response!