Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 32 lines (22 sloc) 0.616 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#!/usr/bin/env ruby -wKU

require 'synack'
# require File.join(File.dirname(__FILE__), '..', 'lib', 'synack')

USAGE = %q{
Hi! It looks like you're trying to connect to a Synack server, which is great,
but you didn't specify a URI.

Try this instead:

synack_client 127.0.0.1:11113

You'll probably have better luck that way.
}

if ARGV.empty?
  puts USAGE
  exit
end

host, port = ARGV.first.split(/:/)

begin
  client = Synack::Client.new host: host, port: (port || 11113)

  _input = STDIN.gets.chomp
  client.say _input
rescue DRb::DRbConnError => e
  puts "Some kind of connection error occurred: #{e}"
end
Something went wrong with that request. Please try again.