This project implements a simple telnet + server-sent events (SSE) application with a terminal-like web interface, utilizing TailwindCSS for styling and Golang for the backend. The application serves a static website and maintains a telnet service for receiving messages, which are then broadcasted in real-time to connected web clients via SSE.
- Static website serving using Golang
- Real-time message broadcasting using Server-Sent Events (SSE)
- Terminal-like interface for message display using TailwindCSS
- Telnet service for receiving messages
To run this project, you need to have the following installed:
- Golang (version 1.15 or later)
- Node.js and npm (for TailwindCSS)
godotenv
package for Golang
- Clone the repository:
git clone https://github.com/nkoster/telsse
cd telsse
- Install the Go dependencies:
go mod tidy
- Run the Golang server:
go run main.go
or build a binary, and run the binary telsse
CGO_ENABLED=0 go build -ldflags="-extldflags=-static"
./telsse
Make sure you have configured your .env
file. See below in the Configuration section.
- Open a web browser and navigate to
http://localhost:8080
to view the SSE chat interface. Replace8080
with the actual port number specified in your.env
file. - Use a telnet client to connect to the telnet service and send messages. Replace
5023
with the actual port number specified in your.env
file:
telnet localhost 5023
or
tail -f /var/log/nginx/access.log | telnet localhost 5023
- Messages sent via telnet will appear in real-time on the web interface.
Create a .env
file in the root directory of your project with the following content:
UI=./ui
HTTP_PORT=8080
TELNET_PORT=5023
LOG=false # when true, telnet lines also appear in the server log
Contributions to this project are welcome. Please feel free to fork the repository, make changes, and submit pull requests.
This project is licensed under the MIT License.