ServerListPlus icon indicating copy to clipboard operation
ServerListPlus copied to clipboard

SLP Virtual Hosts | Non-functional with SRV, or proxied records

Open MackenzieMolloy opened this issue 4 years ago • 8 comments
trafficstars

Virtual Host (MOTD) doesn't work when the domains are either setup with SRV records or proxied through a service such as Cloudflare.

I did notice there was an issue from 2015 about this, and how it's almost impossible to add, but maybe have a look at DomainAnalysis which tracks domain usage perfectly... not sure if there is any difference between a ping, and a connection. https://www.spigotmc.org/resources/domainanalytics.81585/ <-- They also provide the source code via GitHub Repo.

MackenzieMolloy avatar Feb 25 '21 01:02 MackenzieMolloy

AFAICT they just use getVirtualHost(): https://github.com/FlowZz99/DomainAnalytics/blob/53db0536aaba1bd564141fe0c0a635788212e71d/src/main/java/it/flowzz/domainanalytics/listeners/PlayerLoginEventListener.java#L37

which is the same I use:

https://github.com/Minecrell/ServerListPlus/blob/7221f5d636575f980206b54f9f358ffb1036e7d8/Bungee/src/main/java/net/minecrell/serverlistplus/bungee/BungeePlugin.java#L183

So I would expect it to return the same values.

stephan-gh avatar Feb 25 '21 09:02 stephan-gh

Odd, could the difference be that with SLP - it's a "ping" and DomainAnalysis is for connections to the server?

As when I enable proxied, or use a SRV record - the MOTD is that set to the personalise/description default.

Hosts: mc.frozenwaters.net: Default: Description: - |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] &c We're back, bigger and better than before! play.frozenwaters.net: Default: Description: - |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] 2 &c We're back, bigger and better than before!

Default: Description:

  • |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] &c We're back, bigger and better than before!
  • |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] &c We're back, bigger and better than before! Players: Hover:
    • |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] &c We're back, bigger and better than before! Personalized:

Description:

  • |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] &c We're back, bigger and better than before!
  • |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] &c We're back, bigger and better than before! Players: Hover:
    • |- &3&l Frozen&b&lWaters &7[1.8 - 1.16] &c We're back, bigger and better than before!

MackenzieMolloy avatar Feb 25 '21 09:02 MackenzieMolloy

Odd, could the difference be that with SLP - it's a "ping" and DomainAnalysis is for connections to the server?

It seems unlikely but it is possible. In any case, I'm sure that SLP is making use of all the information that is available. If it's not working it seems to be a limitation of the protocol.

What I mentioned in https://github.com/Minecrell/ServerListPlus/issues/52#issuecomment-116677886 probably still applies - if you are making use of SRV records you need to match the destination hostname of the SRV in the virtual hosts.

stephan-gh avatar Feb 25 '21 09:02 stephan-gh

Ah, yes. I got it working (using play instead of play.domain.net) ... might be useful if you could specify that on the wiki. As I myself was thinking with SRV records - it was the full domain.

MackenzieMolloy avatar Feb 25 '21 11:02 MackenzieMolloy

Ah, yes. I got it working (using play instead of play.domain.net) ... might be useful if you could specify that on the wiki. As I myself was thinking with SRV records - it was the full domain.

Sorry, now I'm confused. play isn't a real domain... Could you explain how you set up the SRV/... whatever records?

stephan-gh avatar Feb 25 '21 11:02 stephan-gh

In the config I sent above, I replaced "play.frozenwaters.net" with "play" and that made it work. I'm using a unproxied A record along with a SRV record.

MackenzieMolloy avatar Feb 25 '21 11:02 MackenzieMolloy

But the SRV record doesn't point to play I assume? Not sure why the end of the domain suddenly disappears...

stephan-gh avatar Feb 25 '21 11:02 stephan-gh

This is how I have my records setup;

A Record image

SRV image

MackenzieMolloy avatar Feb 25 '21 11:02 MackenzieMolloy