forked from TeamTofuShop/segatools
Modify host header in HTTP requests to bypass domain censorship in China. (#34)
Co-authored-by: Sanheiii <35133371+Sanheiii@users.noreply.github.com> Reviewed-on: Dniel97/segatools#34 Co-authored-by: Sanhei <sanhei@noreply.gitea.tendokyu.moe> Co-committed-by: Sanhei <sanhei@noreply.gitea.tendokyu.moe>
This commit is contained in:
@ -121,6 +121,8 @@ void dns_config_load(struct dns_config *cfg, const wchar_t *filename)
|
||||
cfg->title,
|
||||
_countof(cfg->title),
|
||||
filename);
|
||||
|
||||
cfg->replaceHost = GetPrivateProfileIntW(L"dns", L"replaceHost", 0, filename);
|
||||
}
|
||||
|
||||
void hwmon_config_load(struct hwmon_config *cfg, const wchar_t *filename)
|
||||
|
@ -16,6 +16,10 @@ HRESULT dns_platform_hook_init(const struct dns_config *cfg)
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
if(cfg->replaceHost){
|
||||
http_hook_init();
|
||||
}
|
||||
|
||||
hr = dns_hook_push(L"tenporouter.loc", cfg->router);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
|
@ -12,6 +12,7 @@ struct dns_config {
|
||||
wchar_t billing[128];
|
||||
wchar_t aimedb[128];
|
||||
wchar_t title[128];
|
||||
bool replaceHost;
|
||||
};
|
||||
|
||||
HRESULT dns_platform_hook_init(const struct dns_config *cfg);
|
||||
|
Reference in New Issue
Block a user