Skip to content

[Pro] Allow installation on corporate networks (HTTP Proxy) #11244

@damienalexandre

Description

@damienalexandre

Bug report

I wanted to give a try to PHPStan Pro but I cannot download it:

$ ./vendor/bin/phpstan --pro -vv

Note: Using configuration file /opt/app-root/src/phpstan.dist.neon.
Could not download the PHPStan Pro executable: Connection to tls://fixer-download-api.phpstan.com:443 timed out after 5 seconds (ETIMEDOUT)

Try different DNS servers in your configuration file:

parameters:
	pro:
		dnsServers!:
			- '8.8.8.8'

I did the "dnsServers" trick but it's not changing anything, I know what's blocking the request, it's the corporate proxy enforced by my client on developer computers.

I don't think the ReactPHP Socket Connector supports HTTP Proxy:

https://github.com/phpstan/phpstan-src/blob/32f351a24ce103f120f413cd104bc411608df109/src/Command/FixerApplication.php#L326-L336

When it comes to proxy, config file (like for dnsServers) or env vars are usually supported:

$ echo $HTTPS_PROXY
http://proxy-xxx.intra.xxx:8080/

I see two paths on this issue:

  • adding support for HTTP Proxy on the "downloadPhar" method
  • allowing to download the Phar manually

Thanks a lot 🙏

Code snippet that reproduces the problem

No response

Expected output

I expect to be able to run "--pro" from a corporate network / computer. It should download the Phar using the system proxy configuration.

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions