Skip to content

Added ability to set proxy to http #570

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/generators/templates/rpush.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
# If the logger goes to stdout, you can disable foreground logging to avoid duplication.
# config.foreground_logging = false

# Define proxy
# config.proxy = URI('http://localhost:3128')
end

Rpush.reflect do |on|
Expand Down
2 changes: 1 addition & 1 deletion lib/rpush/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def configure
end
end

CURRENT_ATTRS = [:push_poll, :embedded, :pid_file, :batch_size, :push, :client, :logger, :log_file, :foreground, :foreground_logging, :log_level, :plugin]
CURRENT_ATTRS = [:push_poll, :embedded, :pid_file, :batch_size, :push, :client, :logger, :log_file, :foreground, :foreground_logging, :log_level, :plugin, :proxy]
DEPRECATED_ATTRS = []
CONFIG_ATTRS = CURRENT_ATTRS + DEPRECATED_ATTRS

Expand Down
1 change: 1 addition & 0 deletions lib/rpush/daemon/dispatcher/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def initialize(app, delivery_class, _options = {})
@app = app
@delivery_class = delivery_class
@http = Net::HTTP::Persistent.new(name: 'rpush')
@http.proxy = Rpush.config.proxy if Rpush.config.proxy.present?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only applies to HTTP dispatchers, and does not contemplate APNSv2/p8. Could you maybe add it to those dispatchers also?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry but I didn't use APNS, so I cannot test it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a spec not be enough to create confidence in its functionality?

end

def dispatch(payload)
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy