Hide IP with Javascript

uttmmmm5

Member
May 18, 2016
110
5
Hey there,
I saw something in the HoloRP Cms and i have a question about it.
Code:
<?php

    $hosts = array(
        'ip:port',
        'ipb:port',
        //'ipc:port',
        //'ipd:portb',
        //'ipe:port'
    );
   
    $wshosts = array(
        'ip:sport',
        'ipb:sport',
        //'ipc:sport'
        //'ipe:sport'
    );
   
   
    $host = explode(":", $hosts[array_rand($hosts)], 2);
    $wshost = explode(":", $wshosts[array_rand($wshosts)], 2);

?>
this is on the top of client.php

Code:
"connection.info.host" : <?= $host[0]; ?>,
"connection.socket.host" : <?= $wshost[0]; ?>,
"connection.info.port" : <?= $host[1]; ?>,
"connection.socket.port" : <?= $wshost[1]; ?>,

and this is in flashvars section in client.php

Now my question: Is it possible to say, that the server should connect everytime with "ip : port" but always show in the client.php file the fake-informations from "ipb : port" ?

Best Regards
 

CosmoPeak

PeakRP.com
May 15, 2016
271
268
No, it's impossible to hide the server IP. You can obfuscate and try to hide it as much as you want, but the client needs to know the IP it's connecting to. The best you can do is hide it behind proxies or have some protection on your server.
 

CosmoPeak

PeakRP.com
May 15, 2016
271
268
But isn't it possible to do it like this:
Users can only see fake IP when they look at source but the client can see the real ip?
No, the user and the client are the same thing. The client IP has to somehow get to the browser, which is visible to the user (the user controls the browser - the client). The internet isn't magic.
 

uttmmmm5

Member
May 18, 2016
110
5
No, the user and the client are the same thing. The client IP has to somehow get to the browser, which is visible to the user (the user controls the browser - the client). The internet isn't magic.
Ok i understand.
Hmm...
Can you then reply to my pm?
Because it‘s possible to hide it better than like i did it haha.
Cause when it wouldn‘t be possible to hide ut better than i did it then every user needs 1 second to get the server ip of every hotel which uses websockets.
 

Users who are viewing this thread

Top