Module: EventMachine::Socksify

### Home Classes Methods

### In Files

- lib/em-socksify/errors.rb
- lib/em-socksify/socks5.rb
- lib/em-socksify/socksify.rb
- lib/em-socksify/version.rb

### Namespace

- MODULE EventMachine::Socksify::SOCKS5
- CLASS EventMachine::Socksify::SOCKSError

### Methods

- #socks_hook
- #socks_receive_data
- #socks_unhook
- #socksify

### Class/Module Index

Quicksearch

- EventMachine
- EventMachine::Connectify
- EventMachine::Connectify::CONNECT
- EventMachine::Connectify::CONNECTError
- EventMachine::Socksify
- EventMachine::Socksify::SOCKS5
- EventMachine::Socksify::SOCKSError
- Base64

No matching classes.

# EventMachine::Socksify

### Constants

VERSION

### Public Instance Methods

socks_hook() click to toggle source

    # File lib/em-socksify/socksify.rb, line 20
    def socks_hook
      if @socks_version == 5
        extend SOCKS5
      else
        raise ArgumentError, 'SOCKS version unsupported'
      end

      class << self
        alias receive_data socks_receive_data
      end
    end

socks_receive_data(data) click to toggle source

    # File lib/em-socksify/socksify.rb, line 40
    def socks_receive_data(data)
      @socks_data << data
      socks_parse_response
    end

socks_unhook(ip = nil) click to toggle source

    # File lib/em-socksify/socksify.rb, line 32
    def socks_unhook(ip = nil)
      class << self
        remove_method :receive_data
      end

      @socks_deferrable.succeed(ip)
    end

socksify(host, port, username = nil, password = nil, version = 5, &blk) click to toggle source

    # File lib/em-socksify/socksify.rb, line 4
    def socksify(host, port, username = nil, password = nil, version = 5, &blk)
      @socks_target_host = host
      @socks_target_port = port
      @socks_username = username
      @socks_password = password
      @socks_version = version
      @socks_data = ''

      socks_hook
      socks_send_handshake

      @socks_deferrable = DefaultDeferrable.new
      @socks_deferrable.callback(&blk) if blk
      @socks_deferrable
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.