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

can we support proxy configuration for dispatcher? #208

Closed
modx-space opened this issue Oct 13, 2015 · 4 comments
Closed

can we support proxy configuration for dispatcher? #208

modx-space opened this issue Oct 13, 2015 · 4 comments
Labels

Comments

@modx-space
Copy link

add a proxy configuration option and provide a way to use it in different dispatcher.

We need to do a monkeypatch for this.

module Rpush
  module Daemon
    module Dispatcher
      class Http
        def initialize(app, delivery_class, _options = {})
          @app = app
          @delivery_class = delivery_class
          proxy = "xxx"
          @http = Net::HTTP::Persistent.new('rpush', proxy)
        end

        def dispatch(payload)
          @delivery_class.new(@app, @http, payload.notification, payload.batch).perform
        end

        def cleanup
          @http.shutdown
        end
      end
    end
  end
end

Can we support this in rpush?
~
Thanks

@diegoRodriguezAguila
Copy link

I would also like to have proxy support, as I'm behind a proxy in work and can't develop using the gem.
@shawzt how does this monkey patch work? should it work if I put something like proxy="proxy:8080" ?

@modx-space
Copy link
Author

@diegoRodriguezAguila

due to GCM uses http as its dispatcher, please refer to daemon-gcm, so we just patched the http-dispatcher to add proxy support. Please see the attached code above.

@Fivell
Copy link
Contributor

Fivell commented Sep 7, 2017

builded in proxy support sound great, now only possibility is to patch dispatchers

@stale
Copy link

stale bot commented Aug 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please leave another comment. This issue will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants