https://github.com/spacemeowx2/tokio-smoltcp
Async version of smoltcp
https://github.com/spacemeowx2/tokio-smoltcp
async smoltcp tap tcpip-stack tokio tun
Last synced: 13 days ago
JSON representation
Async version of smoltcp
- Host: GitHub
- URL: https://github.com/spacemeowx2/tokio-smoltcp
- Owner: spacemeowx2
- Created: 2021-05-07T20:25:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-30T15:44:41.000Z (19 days ago)
- Last Synced: 2025-09-30T15:47:47.573Z (19 days ago)
- Topics: async, smoltcp, tap, tcpip-stack, tokio, tun
- Language: Rust
- Homepage:
- Size: 83 KB
- Stars: 41
- Watchers: 2
- Forks: 16
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# tokio-smoltcp
A async wrapper for [`smoltcp`](https://github.com/smoltcp-rs/smoltcp).
## Note
`v0.1.x` does not follow semver, the API may change at any time.
## Example
See [examples/pcap.rs](examples/pcap.rs).
```sh
cargo build --example pcap && sudo ./target/debug/examples/pcap -h
```This example uses [`pcap`](https://crates.io/crates/pcap) as backend and do the following things:
1. Bind a UDP port and send a DNS request to `114.114.114.114:53` and get the `www.baidu.com`'s IP.
2. Create a `TcpStream` and send a simple HTTP/1.0 request, then print the HTTP response.
3. Create a echo server listening to `0.0.0.0:12345`, accept incoming connections and send the data back.