networker-rs
networker-rs is a Rust library that provides networking utilities for TCP, UDP, WebSocket, and HTTP functionalities, inspired by Go's net package and JavaScript's socket.io. It simplifies common networking tasks and enables event-driven networking with an easy-to-use API.
Latest update: Made client/server communication instead of p2p communication
Features
-
TCP Support
- Dial connections to a specified address.
- Listen for incoming connections.
- Emit events and handle specific message events.
- Utility to read and write to TCP streams.
-
UDP Support
- Send messages to a specified address.
- Receive messages on a specified address.
-
WebSocket Support
- Connect to WebSocket servers.
- Start a WebSocket server and handle bidirectional communication.
- Emit and listen for events/messages.
-
HTTP Support
- Simple HTTP GET and POST request functionality.
Installation
Add the following to your Cargo.toml:
[]
= "0.2.0" # Replace with the latest version
Example Usage
TCP Example
use EasySocket;
UDP Example
use net;
WebSocket Example
use EasySocket;
HTTP Example
use EasyHttp;
License
This project is licensed under the MIT License. See the LICENSE file for details.