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

IPv6 in sv_downloadurl #1559

Closed
d47081 opened this issue Jan 5, 2024 · 10 comments
Closed

IPv6 in sv_downloadurl #1559

d47081 opened this issue Jan 5, 2024 · 10 comments

Comments

@d47081
Copy link

d47081 commented Jan 5, 2024

Does sv_downloadurl in valve/server.cfg support IPv6?

I can download resources trough IPv4 protocol only - just need IPv6 for Yggdrasil connections.

@mittorn
Copy link
Member

mittorn commented Jan 5, 2024 via email

@d47081
Copy link
Author

d47081 commented Jan 5, 2024

Can I contribute to this issue or it's closed part of the valve folder?

@a1batross
Copy link
Member

a1batross commented Jan 5, 2024 via email

@mittorn
Copy link
Member

mittorn commented Jan 8, 2024 via email

@d47081
Copy link
Author

d47081 commented Jan 14, 2024

I've tried to connect trough DNS, as looks like resolver is defined in net_ws.c and priority given to IPv6 there

it could be useful to provide multiple addresses in priority, e.g. yggapi.duckdns.org/fastdl/...

  1. Yggdrasil / IPv6 address - where data encrypted by default
  2. regular IPv4 address
  3. some another IPv4 address

@d47081
Copy link
Author

d47081 commented Jan 15, 2024

Interesting, how does another players skins loading to my client - trough theirs fastdl?

This question about has it a sense to make IPv6 for secure connections or unsecured traffic going from third party requests anyway

d47081 pushed a commit to YGGverse/xash3d-fwgs that referenced this issue Jan 15, 2024
@d47081
Copy link
Author

d47081 commented Jan 15, 2024

Well, found a time for this subject and drafted some implementation in YGGverse@7ff3e59

I think it useful to have separated option like sv_downloadurl_ipv6 beside default sv_downloadurl

  • to keep old clients compatibility
  • ipv6 option, when provided, loading in higher priority - that allows to use encrypted Yggdrasil connection trough http

Could somebody of core devs check and comment this way, haves it a sense before make any PRs

d47081 pushed a commit to YGGverse/xash3d-fwgs that referenced this issue Jan 15, 2024
d47081 pushed a commit to YGGverse/xash3d-fwgs that referenced this issue Jan 15, 2024
d47081 pushed a commit to YGGverse/xash3d-fwgs that referenced this issue Jan 15, 2024
@d47081
Copy link
Author

d47081 commented Jan 15, 2024

Please, help me to complete server side condition to return sv_downloadurl or sv_downloadurl_ipv6 depending of remote IP type. Here is the subject line, but I don't know how to check current connection there
https://github.com/YGGverse/xash3d-fwgs/blob/ipv6-master-support/engine/server/sv_custom.c#L565

It should be something like from.type6 == NA_IP6 but for sv_client_t

void SV_SendResources( sv_client_t *cl, sizebuf_t *msg )
{
...

// is IPv6
if ( from.type6 == NA_IP6 ) // how to?
	url = sv_downloadurl_ipv6.string;

// is IPv4
else 
	url = sv_downloadurl.string;

if ( COM_CheckString( url ) && Q_strlen( url ) < 256 )
{ 
	MSG_BeginServerCmd( msg, svc_resourcelocation );
	MSG_WriteString( msg, url );
}

@d47081
Copy link
Author

d47081 commented Jan 15, 2024

Found, it's cl->netchan.remote_address.type6 - struct of sv_client_t passed to this method

d47081 pushed a commit to YGGverse/xash3d-fwgs that referenced this issue Jan 15, 2024
@d47081
Copy link
Author

d47081 commented Jan 15, 2024

Finally, the task was completed in branch sv-downloadurl-ipv6 PR #1577

Example of server.cfg for documentation:

// fast download
sv_downloadurl_ipv6 "http://[xxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]/fastdl/half-life/" - IPv6/Yggdrasil connections
sv_downloadurl "http://xx.xx.xx.xx/fastdl/half-life/" - clearnet for regular users
sv_allowdownload 1

@d47081 d47081 closed this as completed Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants