The Nex Server is a simple server that serves files and directory listings over a TCP connection. It is designed to be easy to use and can be customized using a configuration file in TOML format.
-
Installation
Clone this repository to your local machine:
git clone https://github.com/ShreyanJain9/nexserver cd nexserver cd build go build main.go sudo mv ./main /usr/local/bin/nex
I'll add a Makefile soon.
-
Configuration
The Nex Server can be configured using a TOML configuration file. By default, it looks for the configuration file at
/etc/nex/config.toml
. You can specify a different configuration file using the-config
command-line flag.The configuration file should contain the following parameters:
RootDir = "/path/to/your/files" Port = 1900
RootDir
: The root directory from which files will be served.Port
: The port number on which the server will listen for incoming connections.
-
Running the Server
To run the Nex Server with the default configuration file path:
nex
To run the server with a custom configuration file:
nex -config /path/to/your/config.toml
The Nex protocol is a simple text-based protocol that allows clients to request files or directory listings from the Nex Server. Read more here
-
File Request
To request a file, the client should send the path of the file it wants to retrieve. The server will respond with the contents of the requested file.
client: /path/to/file.txt server: Contents of the file...
-
Directory Listing Request
To request a directory listing, the client should send the path of the directory it wants to list. The server will respond with a list of files and subdirectories in the requested directory.
client: /path/to/directory/ server: => file1.txt server: => subdirectory/
Contributions to the Nex Server are welcome! If you encounter any issues, have suggestions for improvements, or would like to add features, feel free to open an issue or submit a pull request.
This project is licensed under the GNU AGPLv3. See the LICENSE file for details.