Modify host header in HTTP requests to bypass domain censorship in China. #34

Merged
Dniel97 merged 6 commits from Sanhei/segatools:develop into develop 2024-11-11 16:24:35 +00:00
Contributor
No description provided.
Sanhei added 1 commit 2024-09-05 07:38:58 +00:00
Owner

Hello,

thanks for the PR but what is the benefit of using the modified host header instead of a VPN? I'm not sure if I really wanna include this in segatools tho as this is not really needed to play arcade games.

Hello, thanks for the PR but what is the benefit of using the modified host header instead of a VPN? I'm not sure if I really wanna include this in segatools tho as this is not really needed to play arcade games.
Dniel97 added the
question
label 2024-09-09 20:51:27 +00:00
Author
Contributor

China enforces strict internet censorship, and servers located in mainland China can only be accessed through domains that have been registered and approved. To bypass these restrictions, Chinese players often use servers in Hong Kong or Japan to handle power-on requests, which then return a mainland China-based title address. However, the connection between mainland China and these regions is often unstable. By merging this pull request, server administrators will be able to register their own domains and fully host their servers within mainland China, thereby improving connectivity.

China enforces strict internet censorship, and servers located in mainland China can only be accessed through domains that have been registered and approved. To bypass these restrictions, Chinese players often use servers in Hong Kong or Japan to handle power-on requests, which then return a mainland China-based title address. However, the connection between mainland China and these regions is often unstable. By merging this pull request, server administrators will be able to register their own domains and fully host their servers within mainland China, thereby improving connectivity.
Contributor

naominet.jp servers should by specification all be capable of serving requests that're completely absent of a Host header. As the issue appears to be with exclusively auth, that would be the only domain of concern.

I might suggest this would be better implemented as game patches to just not add the Host header when constructing the auth request. (Equally trivial patches could be written to change the host to a different one rather than remove it entirely, if required)

naominet.jp servers should by specification all be capable of serving requests that're completely absent of a Host header. As the issue appears to be with exclusively auth, that would be the only domain of concern. I might suggest this would be better implemented as game patches to just not add the Host header when constructing the auth request. (Equally trivial patches could be written to change the host to a different one rather than remove it entirely, if required)
Author
Contributor

naominet.jp servers should by specification all be capable of serving requests that're completely absent of a Host header. As the issue appears to be with exclusively auth, that would be the only domain of concern.

I might suggest this would be better implemented as game patches to just not add the Host header when constructing the auth request. (Equally trivial patches could be written to change the host to a different one rather than remove it entirely, if required)

@Dniel97

Servers in mainland China check the HOST header for domain filings before processing HTTP requests. If a domain isn't filed, the request is redirected for filing, causing the poweron request to fail. Without this change, servers in China won't function properly unless the data center risks penalties to assist.

> naominet.jp servers should by specification all be capable of serving requests that're completely absent of a Host header. As the issue appears to be with exclusively auth, that would be the only domain of concern. > > I might suggest this would be better implemented as game patches to just not add the Host header when constructing the auth request. (Equally trivial patches could be written to change the host to a different one rather than remove it entirely, if required) @Dniel97 Servers in mainland China check the HOST header for domain filings before processing HTTP requests. If a domain isn't filed, the request is redirected for filing, causing the poweron request to fail. Without this change, servers in China won't function properly unless the data center risks penalties to assist.
Author
Contributor

Hey @Dniel97 , I’ve responded to the questions you raised earlier on PR #34, but it seems like there hasn’t been any activity since then. Just wondering if there’s any update or if you need anything else from my side? When you’ve got a moment, would you mind taking a look? Thanks!

Hey @Dniel97 , I’ve responded to the questions you raised earlier on PR #34, but it seems like there hasn’t been any activity since then. Just wondering if there’s any update or if you need anything else from my side? When you’ve got a moment, would you mind taking a look? Thanks!
Owner

Hey @Sanhei sorry for the late reply. Of you can add an enable option which is default set to False than I will merge your PR.

Hey @Sanhei sorry for the late reply. Of you can add an `enable` option which is default set to False than I will merge your PR.
Sanhei added 1 commit 2024-11-07 02:48:01 +00:00
Sanhei force-pushed develop from 45cca9476d to d9ce894bbc 2024-11-07 03:06:09 +00:00 Compare
Sanhei added 1 commit 2024-11-07 03:11:38 +00:00
Sanhei added 1 commit 2024-11-07 03:19:06 +00:00
Author
Contributor

I added a switch to it and tested the power-on request, and it works properly.

I added a switch to it and tested the power-on request, and it works properly.
Owner

That looks perfect, coiuld you also add a brief explanation to doc/config/common.md which explains that setting? After you added the documentation I will merge it!

That looks perfect, coiuld you also add a brief explanation to [doc/config/common.md](https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/doc/config/chunithm.md) which explains that setting? After you added the documentation I will merge it!
Sanhei added 2 commits 2024-11-11 09:23:22 +00:00
Author
Contributor

I’ve added the brief explanation to doc/config/common.md as requested. Let me know if any further adjustments are needed!

I’ve added the brief explanation to [doc/config/common.md](https://gitea.tendokyu.moe/Dniel97/segatools/src/branch/develop/doc/config/common.md) as requested. Let me know if any further adjustments are needed!
Owner

Perfect, that's enough. I will merge it now!

Perfect, that's enough. I will merge it now!
Dniel97 merged commit ceb2b63e8b into develop 2024-11-11 16:24:35 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Dniel97/segatools#34
No description provided.