telnet

Version, currently 0.5.03 versions

github.com/mjblack/telnet

A Crystal Shard for creating telnet servers and clients

3 stars
0 dependents
License: MIT

Nothing has been indexed for 0.5.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  telnet:
    github: mjblack/telnet
    version: ~> 0.5.0

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.5.0. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

telnet

Crystal CI Telnet shard that provides server and client classes. It provides a parser class that handles telnet events with callbacks.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      telnet:
        github: mjblack/telnet
  2. Run shards install

Usage

Please see examples/simple_server.cr for a more detailed example that showcases telnet command and subnegotiation handling.

require "telnet"

server = Telnet::Server.new("0.0.0.0", 23)
server.on_connect do |session|
  puts "New client connected: #{session.remote_address}"
  dont_echo = Telnet::Command.new_dont(Telnet::Option::ECHO)
  io.write(dont_echo)
  puts "Sent dont echo"
end

server.on_disconnect do |session|
  puts "Client disconnected: #{session.remote_address}"
end

server.on_wont_echo do |session|
  puts "Client: WONT ECHO"
end

# Spawns listener
server.listen

while true
  Fiber.yield
end

Contributing

  1. Fork it (https://github.com/mjblack/telnet/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors