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

Is there a way to let fink know that it needs to tunnel through a proxy? #131

Open
bozzit opened this issue Jul 22, 2024 · 2 comments
Open

Comments

@bozzit
Copy link

bozzit commented Jul 22, 2024

I'm pretty sure https://github.com/amphp/http-tunnel/tree/2.x allows for this, but not sure how to implement this in fink.

I added the package with composer, and added the

use Amp\Http\Tunnel\Https1TunnelConnector;  

to lib DispatcherBuilder.php and attempted to modify as per the example for http-tunnel example like so:

->usingPool(
  new UnlimitedConnectionPool(
     new DefaultConnectionFactory(null, (new ConnectContext)->withTlsContext($tlsContext))
  )
)

to

$socketConnector = new Https1TunnelConnector(new SocketAddress('2.2.21', 8080));

->usingPool(new UnlimitedConnectionPool(
    new DefaultConnectionFactory($socketConnector),
    (new ConnectContext)->withTlsContext($tlsContext))
))

But

getting expected type Amp\Socket\Connect found Amp\Http\Tunnel\Https1TunnelConnector Probably something simple.

Any help would be appreciated

Thankks

@dantleech
Copy link
Owner

I'm not really familiar with the library, but would look for something that bridges Connect interface to whatever interface Https1TunnelConnector implements.

@bozzit
Copy link
Author

bozzit commented Jul 23, 2024

Thanks for the reply, I think I got it figured out.

Needed to add

use Amp\Socket\SocketAddress;
use Amp\Http\Tunnel\Http1TunnelConnector;

and

$socketConnector = new Http1TunnelConnector(new SocketAddress('10.12.10.18', 3131));

then

->usingPool(new UnlimitedConnectionPool(new DefaultConnectionFactory($socketConnector, (new ConnectContext)->withTlsContext($tlsContext))))

I will attempt to add command line parms --proxy-host and --proxy-port (3131) as a default if I can find time I will contribute back the code via PR later on.

Thanks

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

No branches or pull requests

2 participants