• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Browsing websites behind TLS/SSL/HTTPS in a 68K browser

BacioiuC

Well-known member
I'm really trying to switch my development effort over to my SE/30 and use it as much as I can. Sadly, there are a few problems that keep me from going all retro for my gamedev business but I believe I just managed to jump one of the hurdles. In short, since I am using MacIPgw on a raspberry pi (thank you @mactjaap) to get an internet connection I wrote a quick PHP script that can run on an apache2 server on the raspberry pi. Note that I haven't done any web development since early 2007 and I am sure the code itself is not that great, nor is it secure but it could be a start for those looking to go the extra mile with this beautiful macs. A quick video that shows you how it works:




The idea behind it is pretty simple and a tad similar to Web Rendering Proxy, with a couple of hidden bonuses. It leverages the raspberry pi as a web server. Accessing it, you are presented with a form (input box) and a button. Type or paste in the URL of a website you want to visit and the "website's" html template and data are downloaded locally to the raspberry via wget. The content of the website is then added back into the same page you were on, allowing you to browse it as if you would have normally.

The bonuses are that the CSS files (which already don't have that much great support in the browsers that work on our 68K macs) and big images usually are locked behind HTTPS and will not be loaded by your browser leading to pretty decent content speed.

You can think of it as Lynx web browser with a gui and on steroids. To set it up you need a web server (I'm using a raspberry pi) with Apache2, PHP and wget installed:

Code:
<html>

    <body>

        <br>

        <br>

        <center>

                <form method="post" action="">

                <input type="text" name="murl">

                <input type="submit" value="GO">

                </form>

        </center>

     </body>

</html>

 

<?php

$setVar = 0;

function download_website()

{

        $url = ''.$_POST["murl"];

        $outputfile = "dl.html";

        shell_exec('rm -rf '.$outputfile.'');

        $cmd = "wget \"$url\" -O $outputfile";

        echo "<center>========= Your Website Loaded Here ==========</center>";

        shell_exec($cmd);

 

        echo file_get_contents($outputfile);

 

        echo '<base href="'.$url.'" />' .file_get_contents($outputfile);

        $url = '';

        $outputfile  = '';

}

 

if(isset($_POST['murl']))

{

        download_website( );

        unset($_POST['murl']);

        $_POST = array();

 

}

else

{

 

}

?>

The script is also available on pastebin.

Things that don't work:

- Submitting any kind of form on a target website, takes you to the target website.

- No way to login or post messages - just browsing.

- If you want to visit a link in that website? Just copy the link address and paste it in the field at the top of the page.

It can be taken a tad further, have it's input sanitized and even have the HTML it embeds parsed in a such a way that it would auto-post any clicks on a link and load them without requiring you to input it in the address field at the top of the page.

 

Frobozz

Well-known member
Very interesting. I bet with some tuning you could get the contents display to be even more friendly to classic Macs. maybe options to remove all images, convert unicode curly quotes, bullets, etc, to MacRoman code points, etc. Not all sites will be great of course, but just being able to view HTTPS sites on say an SE/30 or Plus would be pretty amazing. 

Just heard of MacIPgw for the first time... You have a VM running on that with the image from here (https://www.macip.net/macipgg-vm-3-0/)? 

 

BacioiuC

Well-known member
I actually have a raspberry pi image sans VM running it from macip.net. The VM should work but only if the computer running the VM is plugged on ethernet, not wifi. 

 
Top