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

Open
Sanhei wants to merge 4 commits from Sanhei/segatools:develop into develop
First-time 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
First-time 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
First-time 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
First-time 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
First-time 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.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u develop:Sanhei-develop
git checkout Sanhei-develop
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.