- formerly libnetsoul-rb
This gem is a simple and efficient Netsoul client implementation written in Ruby. You can use it as a Ruby gem in order to implement your own Netsoul client or just use the provided Netsoul client.
[History]: 8 years after writing my first ruby lines of code, I decide to rewrite this old own with all my Ruby backgrounds. The old design was really bad.
Features
- MD5 authentication
- Kerberos (my own Ruby native extension) authentication. Something is wrong with kerberos server or gssapi [work in progress]
- Data transfert is supported only for the library part, not the provided client, use it at your own. My academic account was closed when I tryed files transfert at school.
- Identification Netsoul client is provided
- Netsoul message library: all netsoul DSL is covered by the 'netsoul/message' module
Installation
On your desktop
gem install netsoul
In your project
Gemfile
gem 'netsoul', '~> 2.3.5'
project.rb
require 'netsoul'
Use the client
After installing the gem netsoul, call the client as described bellow.
Define at least two environment variables : NETSOUL_LOGIN
and NETSOUL_SOCKS_PASSWORD
(see the config for the complete list: https://github.com/fenicks/netsoul-ruby).
netsoul-ruby
or with a config file
netsoul-ruby -config netsoul-config.yml
Example of netsoul-config.yml file
Standard (MD5) authentication
:login: 'kakesa_c'
:socks_password: 'my socks password'
# :unix_password: 'unix password needed for kerberos authentication' # :auth_method must be set to :krb5
# :auth_method: :std # :std, :krb5
# :server_host: 'ns-server.epita.fr'
# :server_port: 4242
# :state: :none # :actif, :away, :connection, :idle, :lock, :server, :none
# :location: 'Home'
# :user_group: 'ETNA_2008'
Kerberos authentication
:login: 'kakesa_c'
:unix_password: 'unix password'
:auth_method: :krb5 # :std, :krb5
# :socks_password: 'my socks password'
# :server_host: 'ns-server.epita.fr'
# :server_port: 4242
# :state: :none # :actif, :away, :connection, :idle, :lock, :server, :none
# :location: 'Home'
# :user_group: 'ETNA_2008'
Build your own Netsoul client with netsoul-ruby gem
Look at the client implementation in this gem: https://github.com/fenicks/netsoul-ruby/blob/master/bin/netsoul-ruby. This client is implemented in less than 80 lines of code ; including option parser, client reconnection, ...
# Install the gem first (Gemfile or 'gem install'), see the 'Installation' section
require 'netsoul/client'
c = Netsoul::Client.new options[:user_opts_hash]
c.connect
# ...
if c.started
# ...
c.send str
# ...
msg = c.get
#...
end
# ...
c.disconnect
Contributing
- Fork it ( https://github.com/fenicks/netsoul-ruby/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request