mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
For a long time, connecting to non-localhost servers didn't work without an HTTPS cert. But it's now once again possible. All you need is an IP with an open port, and a dream. Syntax is a little different than before. To go to `1.2.3.4` at port `5000` - before: `http://1.2.3.4-5000.psim.us` - after: `http://1-2-3-4--5000.insecure.psim.us` Supporting multiple dots in the URL is too complicated, unfortunately. The other way still works: `http://1.2.3.4:5000` And yes, I would 100% recommend that one.
16 lines
858 B
HTML
16 lines
858 B
HTML
<!DOCTYPE html>
|
|
<script>
|
|
var host = document.location.hostname.replace(/-/g, '=').replace(/\./g, '-').replace(/:/g, '--').replace(/=/g, '---');
|
|
var currentPort = document.location.port || (document.location.protocol === 'https:' ? '443' : '80');
|
|
var defaultPort = document.location.protocol === 'https:' ? '443' : '8000';
|
|
var suffix = (currentPort !== defaultPort ? '--' + currentPort : '');
|
|
var protocol = 'https:';
|
|
if (document.location.protocol !== 'https:' && host !== 'localhost') {
|
|
protocol = 'http:';
|
|
suffix += '.insecure';
|
|
}
|
|
document.location.replace(protocol + '//' + host + suffix + '.psim.us' + document.location.pathname);
|
|
</script>
|
|
<p>This is a <a href="http://www.pokemonshowdown.com">Pokémon Showdown</a> server!</p>
|
|
<noscript><p>You'll need to <a href="http://enable-javascript.com/en/">enable JavaScript</a> to play.</p></noscript>
|