Commit Graph

36 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi 465dd6d3ec Update dependencies 2024-03-10 18:30:00 -05:00
Mahmoud Al-Qudsi 99f64a3b3d Update README w/ project status, contributing, and authorship info 2023-09-06 12:55:13 -05:00
Mahmoud Al-Qudsi 065b1a625d Fix a typo in README.md 2023-09-06 12:49:05 -05:00
Mahmoud Al-Qudsi b13785dfb8 Bump to version 0.4.0 2023-09-06 12:47:56 -05:00
Mahmoud Al-Qudsi e7cc956c2a Update dependencies
All are semver-compatible updates; there are no breaking updates at this time.
2023-08-29 15:49:26 -05:00
Mahmoud Al-Qudsi 76d2a97011 Update text of traffic debug messages
Use "proxy client" instead of "remote client" to be clearer.
2023-08-29 15:36:07 -05:00
Mahmoud Al-Qudsi a716d0c3c0 Add some educational comments 2023-08-29 13:42:09 -05:00
Mahmoud Al-Qudsi 55b654ebd1 Leak `remote` instead of wrapping it in an `Arc`
The `Arc<string>` lived as long as the server in all cases, but this way we
don't have to pay any cache invalidation/coherence costs associated with
constantly incrementing and decrementing the atomic reference count.
2023-08-29 13:36:07 -05:00
Mahmoud Al-Qudsi 84ed909836 Log errors establishing upstream connection
The result bubbled up to tokio::spawn() wasn't actually being reported anywhere.
2023-08-28 17:57:05 -05:00
Mahmoud Al-Qudsi ca67fd31ca Don't report ECONNABORT or ECONNRESET as read errors
If we're just idle waiting for bytes to become available to read and the
connection is forcibly reset or aborted, just treat it as if it were closed
normally. This lets us bubble back the actual number of bytes transmitted.

We are still treating these as errors if we encounter them while actively trying
to write to the host/client.

Should resolve https://github.com/mqudsi/tcpproxy/issues/3
2023-08-28 17:38:59 -05:00
Mahmoud Al-Qudsi ae56848993 Bump cargo version to 0.3.1 2022-10-16 16:12:52 -05:00
Mahmoud Al-Qudsi 8a9bc1740d Merge remote-tracking branch 'origin/master'
Removes unused dependencies and makes the client buffer size a constant.
2022-10-16 16:09:54 -05:00
Mahmoud Al-Qudsi ba6e3e5366 Bump cargo version to 0.3.0 2022-10-16 15:56:44 -05:00
Mahmoud Al-Qudsi 939bb98914 Update project README 2022-10-16 15:54:48 -05:00
Mahmoud Al-Qudsi 707df1ef99 Update Cargo.toml metadata 2022-10-16 15:50:26 -05:00
Mahmoud Al-Qudsi 90bc2aa2ca Update/upgrade Cargo dependencies
No breaking changes.
2022-10-16 15:48:53 -05:00
Mahmoud Al-Qudsi 80c529b020 Drop tokio feature "parking_lot"
It's no longer needed with the improvements to the locks in the standard
library.
2022-10-16 15:48:13 -05:00
Mahmoud Al-Qudsi 512832b304 Make per-client buffer size a constant 2022-07-08 17:09:41 -05:00
Mahmoud Al-Qudsi 6a7f1b395c Clean up unused dependencies 2022-07-08 17:07:11 -05:00
Mahmoud Al-Qudsi d520400413 Abort the other half of a connection regardless of Ok/Err
Previously we were only sending an abort signal on successful completion of one
half of a proxied connection and relying on errors to also affect the other
half.

Now we explicitly send an abort after completing with one half of a connection
regardless of whether we did that successfully or with an error.
2022-06-30 18:18:33 -05:00
Mahmoud Al-Qudsi 0164ef836a Aggressively terminate half-closed connections
Previously, if the client closed after receiving a reply, a keepalive connection
to the server would stick around until the timeout, even though we will never
reuse it.
2022-06-30 18:09:33 -05:00
Mahmoud Al-Qudsi b2c2876d03 Upgrade to the latest version of tokio
Also simplify the code by dropping our own async resolution, since the newer
tokio can do that for us.
2022-06-30 16:51:50 -05:00
Mahmoud Al-Qudsi 677b6cd33a Make options easier to use
The local port is now optional, in which case a random free port will be used
(and reported in the output). The `--host` argument is now `--remote-host`.
2022-06-30 16:28:50 -05:00
Mahmoud Al-Qudsi 9ad24e5a96 Correct copy-and-paste of UDP to TCP 2022-06-30 16:07:09 -05:00
Mahmoud Al-Qudsi 44b8380ad8 Update to tokio 0.3 and add IPv6 support 2020-10-22 19:41:05 -05:00
Mahmoud Al-Qudsi 4e44c9fd23 Upgrade to tokio 0.2 and futures 0.3 2020-01-01 14:48:31 -06:00
Mahmoud Al-Qudsi f14dc522f7 Added Makefile 2017-12-05 21:59:28 -06:00
Mahmoud Al-Qudsi 0e99ab0eb6 Just some minor cleanup 2017-08-14 00:34:41 -05:00
Mahmoud Al-Qudsi 49aee2300b Handle being provided an IP and not a hostname
This was insanely hard not due to anything other than lack of
familiarity with futures-rs. It's unfortunate that so much of being able
to use it correctly requires knowledge of futures-rs and not rust
itself. e.g. it is not possible to implement this solution with pattern
matching, usage of futures::future::result() is instead required.

See https://github.com/alexcrichton/futures-rs/issues/551
2017-08-14 00:24:53 -05:00
Mahmoud Al-Qudsi 62651197d5 Thread-free design, using tokio core for asynchronous proxying
No longer spawing two threads for each connection, now using tokio
core to use async network connections which should make this scale
beautifully.
2017-08-13 13:55:55 -05:00
Mahmoud Al-Qudsi 714c5c67f0 Fixed title in README.md 2017-08-12 12:31:09 -05:00
Mahmoud Al-Qudsi 0120052b91 Added README.md 2017-08-12 12:29:46 -05:00
Mahmoud Al-Qudsi 6dd2ebaf5e Added MIT License 2017-08-12 12:28:58 -05:00
Mahmoud Al-Qudsi d5c925c51b Added Cargo.lock to repository 2017-08-12 12:27:44 -05:00
Mahmoud Al-Qudsi e66805a5b2 Initial working version 2017-08-12 12:27:21 -05:00
Mahmoud Al-Qudsi 966102b189 Initial project structure 2017-08-11 22:53:31 -05:00