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

feat(Proxy): use the system proxy option to always use the system proxy settings on insomnia requests #7982

Merged

Conversation

gatzjames
Copy link
Contributor

@gatzjames gatzjames commented Sep 20, 2024

Highlights:

  • Use the system option in the proxy mode in the electron session to use the system proxy settings when running network requests

Closes #7969

How to test:

  • Install squid on one computer (e.g. sudo apt install squid
  • Then replace /etc/squid/squid.conf config with this one:
# Squid normally listens on port 3128
http_port 3128

# Define allowed network
acl allowed_network src 192.168.1.0/24

# Define Safe Ports
acl SSL_ports port 443
acl Safe_ports port 80      # HTTP
acl Safe_ports port 443     # HTTPS
acl CONNECT method CONNECT

# Only allow requests to Safe Ports
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

# Allow access from allowed network
http_access allow allowed_network

# Deny all other access and return 403 Forbidden
http_access deny all
deny_info 403:access_denied all
  • then restart squid sudo systemctl restart squid

  • next on a Windows machine, go to Properties > Proxy settings and setup a proxy pointing to the machine you are running squid on, example:
    image

  • and add 2 Outbound firewall rules to your windows machine (go to firewall, Advanced Firewall settings), one to block all traffic to port 80 and 443, and another to allow all traffic to squid proxy port (in default case is 3128

image

  • next if you use latest beta or latest develop, when you login, you will get error like reported in Insomnia 10.0.0: Cannot login "Network failed" #7969
  • if you use the release recurring build of this PR, it will work, you will be able to login, without configuring any proxy settings on insomnia side

@gatzjames gatzjames force-pushed the feature/ins-4462-respect-os-proxy-settings branch from 5d6fb77 to 3eeef36 Compare September 20, 2024 12:07
@gatzjames gatzjames force-pushed the feature/ins-4462-respect-os-proxy-settings branch from 3eeef36 to f8cc957 Compare September 23, 2024 12:23
@gatzjames gatzjames marked this pull request as ready for review September 23, 2024 12:23
Copy link
Member

@filfreire filfreire left a comment

Choose a reason for hiding this comment

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

Tactical Approval, but actually tested, so it's a tactical blessing

@gatzjames gatzjames merged commit cc6d132 into Kong:develop Sep 23, 2024
8 checks passed
@gatzjames gatzjames deleted the feature/ins-4462-respect-os-proxy-settings branch September 23, 2024 13:38
@@ -23,6 +23,8 @@ async function updateProxy() {
if (httpsProxy) {
proxyRules.push(`https=${parseProxyFromUrl(httpsProxy)}`);
}

session.defaultSession.resolveProxy;
Copy link
Member

@CurryYangxx CurryYangxx Sep 24, 2024

Choose a reason for hiding this comment

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

@gatzjames Is this line useful? resolveProxy is a function but we do not call it here.

Copy link
Contributor

@jackkav jackkav Oct 9, 2024

Choose a reason for hiding this comment

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

@notjaywu notjaywu mentioned this pull request Nov 16, 2024
1 task
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

Successfully merging this pull request may close these issues.

Insomnia 10.0.0: Cannot login "Network failed"
4 participants