Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kezhengjie/epoll-tcp-port-forward
a small demo shows how to use epoll.small program implements port forwarding with epoll.also support Windows using wepoll
https://github.com/kezhengjie/epoll-tcp-port-forward
c epoll epoll-demo epoll-example linux-app linux-epoll port-forward port-forwarding tcp tcp-port-forward wepoll wepoll-example wepoll-tcp-port-forward
Last synced: 6 days ago
JSON representation
a small demo shows how to use epoll.small program implements port forwarding with epoll.also support Windows using wepoll
- Host: GitHub
- URL: https://github.com/kezhengjie/epoll-tcp-port-forward
- Owner: kezhengjie
- License: mit
- Created: 2024-08-06T06:14:06.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-09T07:32:09.000Z (5 months ago)
- Last Synced: 2024-12-25T03:22:16.705Z (9 days ago)
- Topics: c, epoll, epoll-demo, epoll-example, linux-app, linux-epoll, port-forward, port-forwarding, tcp, tcp-port-forward, wepoll, wepoll-example, wepoll-tcp-port-forward
- Language: C
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# epoll-tcp-port-forward
This program implements TCP port forwarding using epoll.
It is designed for those who want to learn epoll through a practical project.
Note: This program is not recommended for production use.
For production, IPTABLES IS A BETTER CHOICE.# Compile And Run
```shell
# Requires cmake to build this project
cd epoll-tcp-port-forward
cmake -B ./build .
cmake --build build --config MinSizeRel --target all
./build/tcp_port_forward 31212 127.0.0.1 22 # Forward any data from port 31212 to local port 22
```Alternatively, you can simply run:
```shell
gcc tcp_port_forward.c
./a.out 31212 127.0.0.1 22 # Forward any data from port 31212 to local port 22
```# Windows
There's no native epoll support on Windows.
Thanks to [wepoll](https://github.com/piscisaureus/wepoll),an open source library that implements epoll API,you could still run this project on Windows.
```shell
cd epoll-tcp-port-forward\windows
git submodule update --init
cmake -B ./build .
cmake --build build --config MinSizeRel --target all
.\build\tcp_port_forward 31212 127.0.0.1 22 # Forward any data from port 31212 to local port 22
```