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

[Bug]: add host-rules by app.commandLine.appendSwitch not work #42218

Closed
3 tasks done
oohusl opened this issue May 17, 2024 · 1 comment
Closed
3 tasks done

[Bug]: add host-rules by app.commandLine.appendSwitch not work #42218

oohusl opened this issue May 17, 2024 · 1 comment

Comments

@oohusl
Copy link

oohusl commented May 17, 2024

Preflight Checklist

Electron Version

30.*

What operating system are you using?

macOS

Operating System Version

macOS 14.4.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

17.0.0

Expected Behavior

resolve the domain names by host-rules

Actual Behavior

host-rules doesn't work

Testcase Gist URL

No response

Additional Information

app.commandLine.appendSwitch('host-rules', 'MAP baidu.com 127.0.0.1')

const createWindow = () => {

// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
});

mainWindow.loadURL("https://www.baidu.com")
mainWindow.webContents.openDevTools();
};

baidu.com still resolve right ip, not the test ip 172.0.0.1

@clavin
Copy link
Member

clavin commented May 21, 2024

Thanks for reaching out and logging this issue! Because we treat our issues list as the team's backlog, we close issues that are questions since they don't represent a task needing to be completed. For most questions about Electron there are a lot of options.

Check out the Electron community. There are also a bunch of helpful people in this Discord that should be willing to point you in the right direction. For your question, I'd recommend the Discord - we have many active help channels and mentors, as well as fellow devs, who can help you out.

@clavin clavin closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants