aioapns icon indicating copy to clipboard operation
aioapns copied to clipboard

it would be nice to have outgoing proxy support

Open thierryba opened this issue 4 years ago • 4 comments

thierryba avatar Sep 14 '21 07:09 thierryba

This is surprisingly hard to do with h2, which this project uses.

It's easy with httpx.

LunNova avatar Aug 14 '22 15:08 LunNova

Maybe I’m a bit late to the party, but I’ve made proof of concept for basic HTTP-proxies.

In a nutshell there’s a HttpProxyProtocol (https://github.com/chrigu/aioapns/blob/feature/http-proxy/aioapns/connection.py#L594) that sets up the connection to the proxy and then initiates the connection to the APNs host using the existing APNsClientProtocols.

As mentioned, it’s still work in progress (it needs types, more error handling and some refactoring). @Fatal1ty Before I start with a PR, could you please have a look and point out any improvements or obvious things that could lead to errors? Thanks!

chrigu avatar Apr 19 '24 09:04 chrigu

Maybe I’m a bit late to the party, but I’ve made proof of concept for basic HTTP-proxies.

In a nutshell there’s a HttpProxyProtocol (https://github.com/chrigu/aioapns/blob/feature/http-proxy/aioapns/connection.py#L594) that sets up the connection to the proxy and then initiates the connection to the APNs host using the existing APNsClientProtocols.

As mentioned, it’s still work in progress (it needs types, more error handling and some refactoring). @Fatal1ty Before I start with a PR, could you please have a look and point out any improvements or obvious things that could lead to errors? Thanks!

My only wish is that you check on your own that the proxy connection will work. There are no tests in the repository, so that's the only way. Regardless, your implementation looks simple and straightforward. Sorry for the late response, I’m looking forward to the PR!

Fatal1ty avatar May 14 '24 07:05 Fatal1ty

My only wish is that you check on your own that the proxy connection will work. There are no tests in the repository, so that's the only way. Regardless, your implementation looks simple and straightforward. Sorry for the late response, I’m looking forward to the PR!

Thanks for looking at it! I saw some smaller issues that I need to take care of before I'll make a PR. Maybe I'll make another PR with some tests, but then you decide if you wanted to introduce pytest in the library for testing.

chrigu avatar May 17 '24 05:05 chrigu

Proxy support was added in #65

Fatal1ty avatar Jun 25 '24 20:06 Fatal1ty

v3.3 is out: https://github.com/Fatal1ty/aioapns/releases/tag/v3.3

Fatal1ty avatar Jun 30 '24 10:06 Fatal1ty