0

I own some websites and do some web development work. However I'm trying to create a method whereby I can create a web page on my server that I can use to surf other websites. There's several reasons for this - hiding my IP, security, bypassing firewalls and so on.

I can't use iFrame, because the content still downloads to the local device. What I want is a solution that downloads the website to the server, renders it and displays it on my webpage, so all content is fed directly from my server. It would be like a browser inside a webpage.

Can someone help me how this can be done? I can do some basic web coding which may help, I don't need it to be fancy, just something simple and basic.

5
  • It's possible to do what you ask, but it requires more than basic web coding. Also you should consider other options, since this isn't probably the best way to achieve what you need. How about using a proxy or VPN? Commented May 29, 2018 at 7:26
  • Hello @AulisRonkainen - I would like to try this method as it's free (I know you can get free proxies, but they often aren't great). Also it means I can access this webpage from any device, anywhere. Is there any template coding I can copy, or could you at least give me an idea of where you're heading with "It's possible to do what you ask"?
    – AutoBaker
    Commented May 29, 2018 at 7:47
  • Certainly. I understand what you want. If you have for example PHP installed you could curl() the website you want and make it a file in your server. Then you should be able view the page via web server. IFrame is the easiest to way to implement this, but you specifically said that's not an option. Sorry, I do not have any other recommendation than to find an easier solution. That said, it IS technically possible to do it this way, although I won't recommend it. Commented May 29, 2018 at 8:41
  • You must realize that a server you rent is in fact much less anonymous than your home internet connection. Earlier, I made a mistake during software development while connected to my VPN server. Within minutes, I received an abuse report from the company I accidentally “scanned”.
    – Daniel B
    Commented May 29, 2018 at 17:05
  • What about using a self-hosted web proxy, like PHP-Proxy?
    – piko
    Commented May 29, 2018 at 18:34

2 Answers 2

0

If you have administrative access to the server an HTTP relay will do what you want.

You can use Socat

socat TCP4-LISTEN:www TCP4:www.domain.org:www

installs a simple TCP port forwarder. WithTCP4-LISTEN it listens on local port "www" until a connection comes in, accepts it, then connects to the remote host (TCP4) and starts data transfer. It will not accept a econd connection.

socat -d -d -lmlocal2 \ TCP4-LISTEN:80,bind=myaddr1,su=nobody,fork,range=10.0.0.0/8,reuseaddr \ TCP4:www.domain.org:80,bind=myaddr2

TCP port forwarder, each side bound to another local IP address (bind). This example handles an almost arbitrary number of parallel or consecutive connections by fork'ing a new process after each accept() . It provides a little security by su'ing to user nobody after forking; it only permits connections from the private 10 network (range); due to reuseaddr, it allows immediate restart after master process's termination, even if some child sockets are not completely shut down. With -lmlocal2, socat logs to stderr until successfully reaching the accept loop. Further logging is directed to syslog with facility local2.

See also

https://stackoverflow.com/questions/34791674/socat-port-forwarding-for-https

0

I managed to get this sorted... ish. It's crude but it works, although sometimes the page is delivered in plain text. For my purposes though, that's not a problem.

Here's my solution using the file_get_contents PHP function a two page process.

Contents of index.php:

<body>

<h1>browser</h1>
/* gets the data from a URL */

?>


<form action="/webb/browse.php" method="post">
url: <input type="text" name="url"><br>
<input type="submit">
</form>

Welcome <?php echo $_POST["url"]; ?><br>

</body>

Contents of browse.php

<body>

<h1>browser</h1>
/* gets the data from a URL */

?>

<form action="/webb/browse.php" method="post">
url: <input type="text" name="url"><br>
<input type="submit">
</form>

url - https://<?php echo $_POST["url"]; ?><br>

<?php

$url = $_POST["url"];
$homepage = file_get_contents('h'.$url);
echo $homepage;

?>

</body>

If anyone cares to refine it they're welcome but this works for me!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .