Last active
April 14, 2022 07:36
-
-
Save sople1/3caca56f0b42cd0c603df1289e3e899d to your computer and use it in GitHub Desktop.
node wininet.dll refresh Internet Setting for proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| /** | |
| * node wininet.dll refresh Internet Setting for proxy | |
| * using ffi, wininet.dll | |
| * | |
| * you may can use InternetSetOptionA rather then InternetSetOptionW | |
| * | |
| * @author SnooeyNET <sople1@snooey.net> | |
| */ | |
| const INTERNET_OPTION_REFRESH = 37 | |
| const INTERNET_OPTION_SETTINGS_CHANGED = 39 | |
| const ffi = require('ffi'); | |
| let inet = ffi.Library('wininet', { | |
| 'InternetSetOptionW': ["bool", ['int', 'int', 'int', 'int']] | |
| }); | |
| inet.InternetSetOptionW(0, INTERNET_OPTION_REFRESH, 0, 0); // InternetSetOption(0, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0); | |
| inet.InternetSetOptionW(0, INTERNET_OPTION_SETTINGS_CHANGED, 0, 0); // InternetSetOption(0, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment