Closed phsc84 closed 1 month ago
@phsc84 are there any security policies or plugins on your end that would block sending requests to domains updates.insomnia.rest
and api.insomnia.rest
?
We whitelisted everything for Insomnia, so the domains you mentioned are accessible from the local desktop directly.
Thanks for your information! Could you join this Slack channel https://chat.insomnia.rest
? So I can DM for more details.
Ok, I'm now on Slack. You will find me under the same username as here on Github.
We found the reason, why the URLs api.insomnia.rest and updates.insomnia.rest are accessible from Chrome but not from Insomnia.
As proxy settings are usually hidden in an enterprise environment, it would be awesome if this "copy the proxy settings" feature could be implemented in Insomnia as well.
I will close this issue and link other similar issues to this answer. Thanks @phsc84 !
@notjaywu Regarding the "copy the proxy settings" feature, should I open a new feature request issue?
@notjaywu Regarding the "copy the proxy settings" feature, should I open a new feature request issue?
Yes, please.
There are already two feature requests about using the system proxy:
That's why I did not create another one but gave the existing ones an upvote.
@notjaywu do you know if there is a way from Electron to fetch then system proxy settings like Chrome does and automatically apply them? (cc @jackkav @gatzjames)
No idea, if this helps, but this is what ChatGPT told me:
Accessing Proxy Settings:
session
object.session.defaultSession.resolveProxy()
to get the proxy information for a URL. This method works for all platforms (Windows, Linux, macOS).Implementation: You can fetch the proxy settings and pass them to your app like this:
const { session } = require('electron');
// Fetch the system proxy settings for a specific URL
session.defaultSession.resolveProxy('http://example.com', (proxy) => {
console.log('Proxy settings:', proxy);
if (proxy.startsWith('DIRECT')) {
console.log('No proxy configured.');
} else {
console.log('Proxy configured:', proxy);
// Pass proxy information to your application
}
});
proxy
will return values like DIRECT
(no proxy) or proxy server addresses like PROXY example.com:8080
.Handling OS Differences:
Electron abstracts the platform-specific proxy configuration. resolveProxy()
uses the system’s proxy settings, which means it will respect the system configuration across Windows, macOS, and Linux without needing additional platform-specific code.
On Windows and macOS, it retrieves proxy settings from system preferences.
On Linux, it respects environment variables such as http_proxy
and https_proxy
.
You can also manually set the proxy using setProxy()
if the system settings need to be overridden or customized.
session.defaultSession.setProxy({
proxyRules: 'http=proxy.example.com:8080;https=secure-proxy.example.com:8443',
proxyBypassRules: '<local>' // Bypass proxy for local addresses
}, () => {
console.log('Proxy has been set.');
});
This should cover all the platforms for your Electron app! Let me know if you need more help with this.
@gatzjames please create a preview beta release and link it here, so that we people can try it to confirm the resolution of the issue.
The fix is part of release 10.1.0-beta.1.
I just tested it and it works like a charm without having to set the proxy manually. Many thanks to the Insomnia guys for this amazing support!
Expected Behavior
I would expect, that I get logged in.
Actual Behavior
I can only start the local scratchpad and get the error "Network failed, please try again."
Reproduction Steps
Is there an existing issue for this?
Additional Information
main.log: [2024-09-17 11:17:12.548] [info] Running version 10.0.0 [2024-09-17 11:17:12.551] [info] [electron client protocol] successfully set default protocol 'insomnia://' [2024-09-17 11:17:12.668] [info] [fix] Running database repairs [2024-09-17 11:17:12.743] [info] [db] Initialized DB at C:\Users\user\AppData\Roaming\Insomnia\insomnia.$TYPE.db [2024-09-17 11:17:12.744] [info] [db] Init responses DB [2024-09-17 11:17:12.745] [info] [db] Init websocket-responses DB [2024-09-17 11:17:12.748] [info] [localstorage] Initialized at C:\Users\user\AppData\Roaming\Insomnia\localStorage [2024-09-17 11:17:12.861] [info] [main] Loading file:///C:/Users/user/AppData/Local/insomnia/app-10.0.0/resources/app.asar/index.html [2024-09-17 11:17:12.876] [info] [main] Registering the hidden window restarting handler [2024-09-17 11:17:12.878] [info] [updater] Using url https://updates.insomnia.rest/updates/win?v=10.0.0&app=com.insomnia.app&channel=stable [2024-09-17 11:17:12.879] [info] [updater] Checking for updates url=https://updates.insomnia.rest/updates/win?v=10.0.0&app=com.insomnia.app&channel=stable [2024-09-17 11:17:13.897] [error] Error: net::ERR_NAME_NOT_RESOLVED at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482)
at SimpleURLLoaderWrapper.emit (node:events:519:28)
[2024-09-17 11:17:14.286] [info] [main] Window ready, handling command line arguments [
'C:\Users\uppc\AppData\Local\insomnia\app-10.0.0\Insomnia.exe'
]
[2024-09-17 11:17:14.288] [info] [main] Check args and create windows []
[2024-09-17 11:17:14.288] [info] [main] Checking for newer version than 10.0.0
[2024-09-17 11:17:14.298] [error] Error: net::ERR_NAME_NOT_RESOLVED
at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482)
at SimpleURLLoaderWrapper.emit (node:events:519:28)
[2024-09-17 11:17:14.303] [info] [main] Error checking for newer version Error: net::ERR_UNEXPECTED
at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482)
at SimpleURLLoaderWrapper.emit (node:events:519:28)
[2024-09-17 11:17:15.301] [warn] [updater] Error: Command failed: 4294967295
System.AggregateException: Mindestens ein Fehler ist aufgetreten. ---> System.Net.WebException: Der Remoteserver hat einen Fehler zur�ckgegeben: (403) Unzul�ssig.
bei System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
bei System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
bei System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Squirrel.Utility.d43`1.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Squirrel.FileDownloader.d 3.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
bei Squirrel.UpdateManager.CheckForUpdateImpl.d2.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Squirrel.UpdateManager.d 7.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Squirrel.Update.Program.d__8.MoveNext()
--- Ende der internen Ausnahmestapel�berwachung ---
bei System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
bei System.Threading.Tasks.Taskd43`1.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Squirrel.FileDownloader.d 3.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
bei Squirrel.UpdateManager.CheckForUpdateImpl.d2.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Squirrel.UpdateManager.d 7.MoveNext()
--- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde ---
bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei Squirrel.Update.Program.d__8.MoveNext()<---
1.GetResultCore(Boolean waitCompletionNotification) bei System.Threading.Tasks.Task
1.get_Result() bei Squirrel.Update.Program.executeCommandLine(String[] args) bei Squirrel.Update.Program.main(String[] args) bei Squirrel.Update.Program.Main(String[] args) ---> (Interne Ausnahme #0) System.Net.WebException: Der Remoteserver hat einen Fehler zur�ckgegeben: (403) Unzul�ssig. bei System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) bei System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result) bei System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result) --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.Utility.[2024-09-17 11:17:17.528] [error] Error: net::ERR_NAME_NOT_RESOLVED at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482)
at SimpleURLLoaderWrapper.emit (node:events:519:28)
Insomnia Version
10.0.0
What operating system are you using?
Windows
Operating System Version
Windows 10 Enterprise, 22H2
Installation method
download "Insomnia.Core-10.0.0.exe" from Github
Last Known Working Insomnia version
No response