My proxy server is behaving strange

I've written a simple http proxy server which redirects all connections to another https proxy server. It is available here: GitHub - OverShifted/proxymix: Converts a https proxy to a local http proxy

It works fine when making requests via curl. It even works fine when I run multiple "curls" at the same time. But it has two (or three?) major problems:

  1. Telegram desktop can't connect to it (It can ping through my proxy, but keeps disconnecting from it)
  2. When I set it as my browser's proxy and open up a few tabs, It consumes almost all of my CPU time. (Fixed)
  3. (This one is not really a problem, but its strange) I get random panics when I'm reading from a channel on my "curl" task (see below) which should not occur because that task is aborted right after the writing end of the channel is dropped.

The inner working of it is pretty simple. I use libcurl to connect to the remote proxy. The "curl object" is owned by a tokio task which communicates with two other tasks via two channels. One of those tasks, reads from the client and the other one writes to it.

Any help will be appreciated.

It seems that your code doesn't have a license yet, I suggest you using AGPL 3.0.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.