netter

Crates.ionetter
lib.rsnetter
version
sourcesrc
created_at2025-04-10 16:01:12.930009+00
updated_at2025-04-20 18:41:30.388438+00
descriptionNetter is a CLI tool for fast and easy server startup!
homepage
repository
max_upload_size
id1628533
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Slava (bjfssd757)

documentation

README

Netter

Netter is a CLI tool for quickly and easily launching servers.

Table of Contents

future

  • Support for complex server structures and routing;
  • Support for different types of servers: gRPC, TCP/UDP sockets;
  • Support for SSL/TLS.

Features

  • Creating a server on web sockets (websockets);
  • Creating HTTP server;
  • Stopping any server launched via netter.

Documentation

Launching a server is done using the command:

netter start

Stopping a server is done using the command:

netter stop

Start

The start command accepts the following parameters:

  • --type: server type: websocket, tcp, udp, http, grpc:
netter start --websocket
  • --host: server address:
netter start --websocket --host 127.0.0.1
  • --port: server port:
netter start --websocket --host 127.0.0.1 --port 808
  • --protect: whether to protect or not (default is no. If the flag is absent, it is also no):
netter start --websocket --host 127.0.0.1 --port 8080 --protect

For the type parameter and server protection status, you do not need to specify anything other than the flag itself.

Stop

The stop command will stop any running server:

netter stop

How does it work?

[!NOTE] When starting a server (netter start), a server state file is created, which specifies the host, pid, port, and protection status. This file helps maintain the existence of a running server and manage it during the process, as each new command you use = code execution from scratch. The running server will continue to work because it is built on asynchronous operations.
The presence of the pid parameter in the state file helps terminate the server. It indicates the process ID of the server in the system. After using the stop command, netter "kills" the process (stops it).

Installation

In case of errors or questions about installing Rust, you can refer to the documentation in the Rust book.

Windows

  • To install Rust on Windows, you need to go to this link and download the language from there.

  • Then you need to install netter:

cargo install netter

Linux

  • Install Rust:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
  • Install netter:
cargo install netter

Dependencies

Netter uses the following key libraries:

  • tokio: An asynchronous runtime for Rust.
  • hyper: An HTTP library for Rust.

Commands

Start

This command will start the server.

Use:

netter start --http --host 127.0.0.1 --port 8080 --path routes.yaml

Flags:

  • --http: will start the server in HTTP mode;

  • --websocket: will start the server in websocket mode;

  • --grpc: will start the server in gRPC mode;

  • --tcp: will start the server in TCP mode;

  • --udp: will start the server in UDP mode;

  • --host: specifies the host for the server;

  • --port: specifies the port for the server:

  • --path: will specify the path to the configuration file for the server;

  • --protect: whether to use ssl/tls for the server. True or False;

Stop

This command will stop the server.

Use:

netter stop
Commit count: 0

cargo fmt