This is a collection of simple servers for testing. They are written in Python and are intended to be run on a local machine or as a docker container.
docker run --name http-test -t -d -p 8080:80 ghcr.io/tim0-12432/simple-test-server:latest
To run the servers locally, you need to have Python 3 and all requirements installed. Then you can run the servers with the following commands:
python http_server.py
python ftp_server.py
python ssh_server.py
python smtp_server.py
python smb_server.py
or you can run it by configuring the environment variables via a .env
-file and calling the run.py
script directly:
python run.py
To run the servers in a docker container, you need to have docker installed. Then you can run the servers with the following commands:
docker pull ghcr.io/tim0-12432/simple-test-server:latest
Example: Run the HTTP server on port 8080:
docker run --name http-test -t -d -p 8080:80 --env TYPE=http ghcr.io/tim0-12432/simple-test-server:latest
Example: Run the FTP server on port 21 with custom files:
docker run --name ftp-test -t -d -p 21:21 --env TYPE=ftp -v ftp_files:/app/ftp-files ghcr.io/tim0-12432/simple-test-server:latest
- User:
anonymous
, no password -> only read access - User:
admin
,test
-> read and write access
The following environment variables can be used to configure the servers:
Variable | Description | Default value |
---|---|---|
TYPE |
The type of the server. Can be http , ssh , smtp , smb or ftp . |
http |
ADDRESS |
The host:port on which the server should listen. | 0.0.0.0:<application> |
By default, the HTTP server serves the files in the http-files
directory. You can add your own files to this directory and they will be served by the server.
By default, the server is reachable at the port 80
. But you can change this by setting the ADDRESS
environment variable.
Open the webpage by opening the address URL in your preferred browser!
By default, the FTP server serves the files in the ftp-files
directory. You can add your own files to this directory and they will be served by the server.
By default, the server is reachable at the port 21
. But you can change this by setting the ADDRESS
environment variable.
You can connect to the FTP server with your preferred FTP client.
ftp
open localhost
By default, the SSH server is reachable at the port 22
. But you can change this by setting the ADDRESS
environment variable.
You can connect to the SSH server with your preferred SSH client.
ssh localhost
By default, the SMTP server is reachable at the port 587
. But you can change this by setting the ADDRESS
environment variable.
You can send emails to the SMTP server with your preferred SMTP client.
Send-MailMessage -From 'User01 <[email protected]>' -To 'User02 <[email protected]>' -Subject 'Test mail' -Body 'This is a test message.' -SmtpServer '127.0.0.1' -Port 587
By default, the SMB server is reachable at the port 445
. But you can change this by setting the ADDRESS
environment variable.
You can connect to the SMB server via network share.
This project is licensed under the MIT License - see the LICENSE file for details.