vapor / apns

Helpful extensions and abstractions for using APNSwift
MIT License
115 stars 29 forks source link

Support for sending PushNotifications via ProxyServer #34

Closed SupaBasti closed 2 years ago

SupaBasti commented 3 years ago

right now, APNSwiftConnection does not support to configure any Proxy-Server.

I would expect to consider the configuration from my configure.swift, e.g.: app.http.client.configuration.proxy = .some(.server(host: "localhost", port: 3128))

kylebrowning commented 3 years ago

I believe this is an issue upstream first, with https://github.com/kylebrowning/APNSwift/issues/104

kylebrowning commented 2 years ago

Closing since this is resolved in upstream

SupaBasti commented 2 years ago

I do not see where it is fixed upstream. In APNSClient.swift HTTPClient is initiated like this using default Configuration() which uses no Proxy:

self.httpClient = HTTPClient(
            eventLoopGroupProvider: configuration.eventLoopGroupProvider.httpClientValue
)

Maybe proxy can be passed in via APNSConfiguration and then used to pass a proxy-enabled Configuration() to HTTPClient

kylebrowning commented 2 years ago

Can you try this. https://github.com/swift-server-community/APNSwift/pull/137

SupaBasti commented 2 years ago

awesome. Thanks a lot!

kylebrowning commented 2 years ago

Did it work @SupaBasti ?

SupaBasti commented 2 years ago

couldn't check it out yet, but from code it looks promising