Class: Faye::Authentication::HTTPClient
- Inherits:
-
Object
- Object
- Faye::Authentication::HTTPClient
- Defined in:
- lib/faye/authentication/http_client.rb
Class Method Summary collapse
Class Method Details
.publish(url, channel, data, key) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/faye/authentication/http_client.rb', line 7 def self.publish(url, channel, data, key) uri = URI(url) req = Net::HTTP::Post.new(url) = {'channel' => channel, 'clientId' => 'http'} ['signature'] = Faye::Authentication.sign(, key) ['data'] = data req.set_form_data(message: JSON.dump()) Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') { |http| http.request(req) } end |