{"action":"created","issue":{"url":"https://api.github.com/repos/slack-ruby/slack-ruby-client/issues/110","repository_url":"https://api.github.com/repos/slack-ruby/slack-ruby-client","labels_url":"https://api.github.com/repos/slack-ruby/slack-ruby-client/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/slack-ruby/slack-ruby-client/issues/110/comments","events_url":"https://api.github.com/repos/slack-ruby/slack-ruby-client/issues/110/events","html_url":"https://github.com/slack-ruby/slack-ruby-client/issues/110","id":180800944,"number":110,"title":"RealTime Example behind Proxy","user":{"login":"ShiroiKuma","id":7948640,"avatar_url":"https://avatars.githubusercontent.com/u/7948640?v=3","gravatar_id":"","url":"https://api.github.com/users/ShiroiKuma","html_url":"https://github.com/ShiroiKuma","followers_url":"https://api.github.com/users/ShiroiKuma/followers","following_url":"https://api.github.com/users/ShiroiKuma/following{/other_user}","gists_url":"https://api.github.com/users/ShiroiKuma/gists{/gist_id}","starred_url":"https://api.github.com/users/ShiroiKuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShiroiKuma/subscriptions","organizations_url":"https://api.github.com/users/ShiroiKuma/orgs","repos_url":"https://api.github.com/users/ShiroiKuma/repos","events_url":"https://api.github.com/users/ShiroiKuma/events{/privacy}","received_events_url":"https://api.github.com/users/ShiroiKuma/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/slack-ruby/slack-ruby-client/labels/bug?","name":"bug?","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-04T03:58:18Z","updated_at":"2016-10-05T00:25:48Z","closed_at":null,"body":"Based on advise from https://github.com/slack-ruby/slack-ruby-bot/issues/97 I have tested the hi_web example from behind my corporate firewall and it works without issue.\r\n\r\nHowever the hi_real_time example does not, even when altered to include the proxy server in the configuration. Currently the only machines on the network with the proxy are headless, so I cannot test the normal Slack client either.\r\n\r\nAm I configuring the proxy correctly here in this code?\r\n\r\n**Log**:\r\n```\r\nI, [2016-10-04T03:53:18.471691 #6660]  INFO -- : post https://slack.com/api/rtm.start\r\nD, [2016-10-04T03:53:18.471804 #6660] DEBUG -- request: Accept: \"application/json; charset=utf-8\"\r\nUser-Agent: \"Slack Ruby Client/0.7.7\"\r\nContent-Type: \"application/x-www-form-urlencoded\"\r\nI, [2016-10-04T03:53:18.875181 #6660]  INFO -- Status: 200\r\nD, [2016-10-04T03:53:18.875356 #6660] DEBUG -- response: content-type: \"application/json; charset=utf-8\"\r\ncontent-length: \"3791\"\r\nconnection: \"close\"\r\naccess-control-allow-origin: \"*\"\r\ncache-control: \"private, no-cache, no-store, must-revalidate\"\r\ncontent-security-policy: \"referrer no-referrer;\"\r\ndate: \"Tue, 04 Oct 2016 03:53:18 GMT\"\r\nexpires: \"Mon, 26 Jul 1997 05:00:00 GMT\"\r\npragma: \"no-cache\"\r\nserver: \"Apache\"\r\nstrict-transport-security: \"max-age=31536000; includeSubDomains; preload\"\r\nvary: \"Accept-Encoding\"\r\nx-accepted-oauth-scopes: \"rtm:stream,client\"\r\nx-content-type-options: \"nosniff\"\r\nx-oauth-scopes: \"identify,read,post,client,apps\"\r\nx-slack-backend: \"h\"\r\nx-slack-req-id: \"e43ecc1d-be89-4f3a-8a80-cac8549171a9\"\r\nx-xss-protection: \"0\"\r\nx-cache: \"Miss from cloudfront\"\r\nvia: \"1.1 9f5fd09f16a7b31d703d6acac7f88026.cloudfront.net (CloudFront)\"\r\nx-amz-cf-id: \"RAOXPlWc12pUzC7CdTWc7mOi5aIfTzxwAUyNkujUneU-QHJbqAiWiA==\"\r\nD, [2016-10-04T03:53:18.888880 #6660] DEBUG -- Slack::RealTime::Concurrency::Celluloid::Socket#connect!: WebSocket::Driver::Client\r\nE, [2016-10-04T03:55:26.196574 #6660] ERROR -- : Actor crashed!\r\nThreadError: Target thread must not be current thread\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-essentials-0.20.5/lib/celluloid/internals/thread_handle.rb:37:in `join'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:97:in `join'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/proxy/actor.rb:28:in `terminate'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/proxy/cell.rb:59:in `terminate'\r\n\t/home/nigel/test/slack-ruby-client/lib/slack/real_time/concurrency/celluloid.rb:42:in `ensure in run_loop'\r\n\t/home/nigel/test/slack-ruby-client/lib/slack/real_time/concurrency/celluloid.rb:42:in `run_loop'\r\n\t/home/nigel/test/slack-ruby-client/lib/slack/real_time/concurrency/celluloid.rb:29:in `connect!'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/calls.rb:28:in `public_send'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/calls.rb:28:in `dispatch'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/call/sync.rb:16:in `dispatch'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/cell.rb:50:in `block in dispatch'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/cell.rb:76:in `block in task'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:339:in `block in task'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/task.rb:44:in `block in initialize'\r\n\t/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/task/fibered.rb:14:in `block in create'\r\n/usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/task/fibered.rb:35:in `terminate': task was terminated (Celluloid::TaskTerminated)\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:323:in `block in cleanup'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:321:in `each'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:321:in `cleanup'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:307:in `shutdown'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:299:in `handle_crash'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:171:in `rescue in run'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:150:in `run'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor.rb:131:in `block in start'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-essentials-0.20.5/lib/celluloid/internals/thread_handle.rb:14:in `block in initialize'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/actor/system.rb:78:in `block in get_thread'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/group/spawner.rb:50:in `block in instantiate'\r\n\tfrom (celluloid):0:in `remote procedure call'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/call/sync.rb:45:in `value'\r\n\tfrom /usr/local/rvm/gems/ruby-2.3.1/gems/celluloid-0.17.3/lib/celluloid/proxy/sync.rb:22:in `method_missing'\r\n\tfrom /home/nigel/test/slack-ruby-client/lib/slack/real_time/client.rb:51:in `start!'\r\n\tfrom hi.rb:49:in `<main>'\r\n```\r\n**hi.rb** :\r\n```\r\nrequire 'slack-ruby-client'\r\n\r\nSlack.configure do |config|\r\n  config.token = ENV['SLACK_API_TOKEN']\r\n  config.logger = Logger.new(STDOUT)\r\n  config.logger.level = Logger::DEBUG\r\n  fail 'Missing ENV[SLACK_API_TOKEN]!' unless config.token\r\nend\r\n\r\nSlack::Web::Client.config do |config|\r\n  config.user_agent = 'Slack Ruby Client/1.0'\r\n  config.proxy = 'http://10.1.1.50:8080'\r\nend\r\n\r\nSlack::RealTime::Client.config do |config|\r\n  config.websocket_proxy = {\r\n    origin: 'http://10.1.1.50:8080',\r\n    headers: { 'User-Agent' => 'Slack Ruby Client/0.7.7' }\r\n  }\r\nend\r\n\r\nclient = Slack::RealTime::Client.new\r\n\r\nclient.on :hello do\r\n  puts \"Successfully connected, welcome '#{client.self.name}' to the '#{client.team.name}' team at https://#{client.team.domain}.slack.com.\"\r\nend\r\n\r\nclient.on :message do |data|\r\n  puts data\r\n\r\n  client.typing channel: data.channel\r\n\r\n  case data.text\r\n  when 'bot hi' then\r\n    client.message channel: data.channel, text: \"Hi <@#{data.user}>!\"\r\n  when /^bot/ then\r\n    client.message channel: data.channel, text: \"Sorry <@#{data.user}>, what?\"\r\n  end\r\nend\r\n\r\nclient.on :close do |_data|\r\n  puts 'Connection closing, exiting.'\r\nend\r\n\r\nclient.on :closed do |_data|\r\n  puts 'Connection has been disconnected.'\r\nend\r\n\r\nclient.start!\r\n```"},"comment":{"url":"https://api.github.com/repos/slack-ruby/slack-ruby-client/issues/comments/251551327","html_url":"https://github.com/slack-ruby/slack-ruby-client/issues/110#issuecomment-251551327","issue_url":"https://api.github.com/repos/slack-ruby/slack-ruby-client/issues/110","id":251551327,"user":{"login":"ShiroiKuma","id":7948640,"avatar_url":"https://avatars.githubusercontent.com/u/7948640?v=3","gravatar_id":"","url":"https://api.github.com/users/ShiroiKuma","html_url":"https://github.com/ShiroiKuma","followers_url":"https://api.github.com/users/ShiroiKuma/followers","following_url":"https://api.github.com/users/ShiroiKuma/following{/other_user}","gists_url":"https://api.github.com/users/ShiroiKuma/gists{/gist_id}","starred_url":"https://api.github.com/users/ShiroiKuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShiroiKuma/subscriptions","organizations_url":"https://api.github.com/users/ShiroiKuma/orgs","repos_url":"https://api.github.com/users/ShiroiKuma/repos","events_url":"https://api.github.com/users/ShiroiKuma/events{/privacy}","received_events_url":"https://api.github.com/users/ShiroiKuma/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T00:25:48Z","updated_at":"2016-10-05T00:25:48Z","body":"Thanks Daniel, I will give that a try, still a beginner in ruby, I'll try to find where to add some log lines.\n\nSent from my iPhone\n\n> On Oct 5, 28 Heisei, at 02:14, Daniel Doubrovkine (dB.) @dblockdotorg <notifications@github.com> wrote:\n> \n> So connect! is failing, but we're getting the wrapper (actor crashed) error. Maybe add some code to Slack::RealTime::Concurrency::Celluloid::Socket#connect! to get a better exception from in there? (that code would be useful as a PR, too)\n> \n> ―\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n"}}
{"actor":{"display_login":"ShiroiKuma"}}