client.rb
# Perform a POST request to the chat server with the specified body
# @param [Hash] body
Perform a POST request to the chat server with the specified body
Perform a POST request to the chat server with the specified body
def post(body)
      poster = Net::HTTP.new(@socket.address, @socket.port)
      poster.use_ssl = true
      poster.keep_alive_timeout = 60
      poster.ssl_timeout = 60
      body = Util::format_message(body == :ping ? '2' : "42#{[
        'message',
        {
          :id => nil,
          :attrs => body
        }.to_json
      ].to_json}")
      opts = @request_options.merge({
        :time_cachebuster => Time.now.to_ms.to_s + '-' + @time_cachebuster.to_s
      })
      uri = URI("https://#{@socket.address}/socket.io/")
      uri.query = URI.encode_www_form(opts)
      request = Net::HTTP::Post.new(uri.request_uri, @headers)
      request.body = body
      @time_cachebuster += 1
      poster.request(request)
    end
def post ( body ) poster = Net :: HTTP . new ( @socket . address , @socket . port ) poster . use_ssl = true poster . keep_alive_timeout = 60 poster . ssl_timeout = 60 body = Util :: format_message ( body == :ping ? '2' : "42#{[
        'message',
        {
          :id => nil,
          :attrs => body
        }.to_json
      ].to_json}" ) opts = @request_options . merge ( { :time_cachebuster => Time . now . to_ms . to_s + '-' + @time_cachebuster . to_s } ) uri = URI ( "https://#{@socket.address}/socket.io/" ) uri . query = URI . encode_www_form ( opts ) request = Net :: HTTP :: Post . new ( uri . request_uri , @headers ) request . body = body @time_cachebuster += 1 poster . request ( request ) end
Perform a POST request to the chat server with the specified body
Perform a POST request to the chat server with the specified body
body
<not_specific>
<not_specific>
None