Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teverett/ktelnet
A java telnet server
https://github.com/teverett/ktelnet
embeddable java rfc-854 telnet telnet-protocol telnet-server
Last synced: 9 days ago
JSON representation
A java telnet server
- Host: GitHub
- URL: https://github.com/teverett/ktelnet
- Owner: teverett
- License: bsd-2-clause
- Created: 2018-11-03T16:37:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T01:46:31.000Z (10 days ago)
- Last Synced: 2024-10-28T05:38:34.543Z (10 days ago)
- Topics: embeddable, java, rfc-854, telnet, telnet-protocol, telnet-server
- Language: Java
- Size: 438 KB
- Stars: 8
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CI](https://github.com/teverett/ktelnet/actions/workflows/main.yml/badge.svg)](https://github.com/teverett/ktelnet/actions/workflows/main.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b7b3babc5b38465bad5c9d00a940e002)](https://app.codacy.com/gh/teverett/ktelnet/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)# kTelnet
A Java library which implements an embeddable Telnet server. The server is fully multithreaded and supports numerous Telnet RFC's.
## License
kTelnet is licensed under the BSD terms
## Maven Coordinates
```
com.khubla.ktelnet
ktelnet
jar```
## Tested with
* [GNU Telnet](https://www.gnu.org/software/inetutils/)
* [Putty](https://www.putty.org/)
* [TerraTerm](https://teratermproject.github.io/index-en.html)
* [Mocha Telnet](https://www.mochasoft.dk/)
* [Windows Telnet](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/telnet)## Using kTelnet
A simple example using the default Telnet implementation:
private final static int THREADS = 20;
private final static int PORT = 2121;public static void main(String[] args) {
try {
/*
* telnet
*/
final TelnetServer telnetServer = new TelnetServer(PORT, THREADS, new BasicShellFactoryImpl());
telnetServer.start();
/*
* wait
*/
Thread.sleep(1000);
System.out.println("Press any key to exit");
System.in.read();
/*
* shutdown
*/
telnetServer.shutdown();
} catch (final Exception e) {
e.printStackTrace();
System.exit(0);
}## Implemented RFC's
* [RFC 727](https://datatracker.ietf.org/doc/html/rfc727) - Logout
* [RFC 856](https://datatracker.ietf.org/doc/html/rfc856) - Binary
* [RFC 857](https://datatracker.ietf.org/doc/html/rfc857) - Echo
* [RFC 858](https://datatracker.ietf.org/doc/html/rfc858) - Suppress Go Ahead
* [RFC 859](https://datatracker.ietf.org/doc/html/rfc859) - Status
* [RFC 860](https://datatracker.ietf.org/doc/html/rfc860) - Mark
* [RFC 885](https://datatracker.ietf.org/doc/html/rfc885) - EOR
* [RFC 1091](https://datatracker.ietf.org/doc/html/rfc1091) - Termtype
* [RFC 1073](https://datatracker.ietf.org/doc/html/rfc1073) - Winsize
* [RFC 1079](https://datatracker.ietf.org/doc/html/rfc1079) - TermspeedTelnet options are enumerated [here](https://www.iana.org/assignments/telnet-options/telnet-options.xhtml)
## Login
Login is implemented by passing an implementation of `AuthenticationHandler` to the shell constructor. A simple properties file based implementation `PropertiesFileAuthenticationHandlerImpl` is provided.
## Custom shells
Custom shells can be implemented by extending the classes `ShellFactory`, `BasicTelnetCommandRegistryImpl` and `AbstractCommand`. A very simple shell which implements the "quit" command is provided: `BasicShellImpl`
## Logging
kTelnet supports logging at the byte level via `NVTSpy`. A console implementation `ConsoleNVTSpyImpl` and a log file implementation `LoggingNVTSpyImpl` are provided.