Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small change to campfire contact to allow the use of a proxy to get to outside world #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/god/contacts/campfire.rb
Expand Up @@ -32,7 +32,7 @@ def base_url
def find_room_id_by_name(room)
url = URI.parse("#{base_url}/rooms.json")

http = Net::HTTP.new(url.host, url.port)
http = Net::HTTP::Proxy(@options[:proxy_addr],@options[:proxy_port]).new(url.host, url.port)
http.use_ssl = true if @options[:ssl]

req = Net::HTTP::Get.new(url.path)
Expand All @@ -55,7 +55,7 @@ def speak(room, message)

url = URI.parse("#{base_url}/room/#{room_id}/speak.json")

http = Net::HTTP.new(url.host, url.port)
http = Net::HTTP::Proxy(@options[:proxy_addr],@options[:proxy_port]).new(url.host, url.port)
http.use_ssl = true if @options[:ssl]

req = Net::HTTP::Post.new(url.path)
Expand All @@ -79,7 +79,7 @@ module Contacts

class Campfire < Contact
class << self
attr_accessor :subdomain, :token, :room, :ssl
attr_accessor :subdomain, :token, :room, :ssl, :proxy_host, :proxy_port
attr_accessor :format
end

Expand Down