2

TLDR;

it's basically the same problem as this question here with a slightly different reason, on a different platform.

I would like to know whether it is possible to configure a custom captive portal detection URL for Chrome on Windows.


I live in mainland China, where practically all Google services are blocked, including the gstatic.com domain. The specific URL http://www.gstatic.com/generate_204 however has been unblocked some time in 2018 (I believe), since Chrome is still widely used here, and it is the default captive portal detection URL of Chrome.

The problem is, due to my specific proxy setup I use to bypass the GFW (details of which I will not get into for time's sake), it is particularly difficult for me to do any kind of path filtering. I can filter by domain, but the problem is that gstatic.com hosts various Google resources, all of which need to be funnelled through the proxy except for http://www.gstatic.com/generate_204. As mentioned above, I have difficulty filtering by path. Therefore what I end up needing to do, is to have a rule that funnels all connections to gstatic.com through the proxy, then every time I connect to a network that has a captive portal, manually disable my proxy and then re-enable it. It's not the end of the world, but it is a bit of an inconvenience nonetheless.

As mentioned by other helpful users in the aforementioned question, there are generate_204 services hosted by other servers - I can even host one on my own server. The problem is that I need a way to configure this URL for Chrome. Thus this question. I would like to know whether it is possible to configure a custom URL for Chrome on Windows, and if so how to do it exactly. Thank you.

1 Answer 1

1
+50

I don't think there is a way to do that in Chrome.
The URL for the captive portal is hardcoded in the source code, so you might have to download the source code, change the URL and recompile the browser for yourself (or better, submit a PR that adds a feature to make the URL customisable for everyone out there 😉).

I am not sure of this, but have you tried to use an extension (like this one) to redirect the http://www.gstatic.com/generate_204 URL to some other URL of your choice?

Also, if you just type http://<your-server>/generate_204 into the address bar, doesn't it work normally without having to change anything in your proxy?

3
  • Ah okay. If it's hard-coded then too bad. The reason "just type <myurl> into the omnibar" doesn't quite cut it is that I'm trying to get the button in Chrome's captive portal prompt to work.
    – cyqsimon
    Nov 21, 2020 at 13:21
  • But the extension you linked is just excellent. It does what it advertises and nothing more, which I highly appreciate as a developer myself. I was initially a bit worried that it may conflict with SwitchyOmega, but it didn't - it seems to intercept the request and respond with a redirect before it reaches the proxy stage. This is exactly what I want because the proxy is non-functional until I sign in through the portal correctly.
    – cyqsimon
    Nov 21, 2020 at 13:34
  • For anyone else who would like to use this plugin for the same purpose, this is the rule I used. Example URL: http://www.gstatic.com/generate_204, Include Pattern: ^(\w+:\/\/)?www.gstatic.com\/generate_204$, Pattern Type: Regex, Redirect To: http://captive.v2ex.co/generate_204.
    – cyqsimon
    Nov 21, 2020 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .