• Please review our updated Terms and Rules here

Proxy for Text Browser

Grizzly Adam

Member
Joined
Aug 26, 2023
Messages
18
Location
North-central Iowa
I have created a dialup server on a RaspPi that I am using to connect my Compaq SLT/286 via it's 2400 baud modem. I am wording what would be the best proxy I could run to cut out all the extraneous coding that my text browser (DOSlynx) can't process anyway. Either something I can just type in, or something that I can install on the Pi.
 
What's the goal? To remove stuff from the page that DOSLynx can't use anyway? Like embedded CSS and JS scripts?

Are you using something like PPP or SLIP to connect to your Pi? Using a TCP stack, so you're looking for an HTTP proxy that you can run your traffic through?
 
The goal is to remove all the extra code that is useless to my browser and, essential, speed up the connection. I am running DOSppp with mtcp and wattcp also functioning.
 
I have no experience with it, but you might want to look at https://www.privoxy.org/ It's a non-caching proxy that has filtering capabilities.

It can also handle decoding HTTPS, so that may work as well.

Since the proxy has a filtering capability, it should be straight forward to create an XSLT script that can be used to eliminate stylesheet elements, script elements, any element that Lynx doesn't support (may as well strip those). You can also remove embedded style attributes from individual elements. (I don't know if Lynx has some CSS support or ignores it completely).

But, as an example, since <DIV> tags are essentially ignored without styling information, you could strip those as well (every little bit helps). What you may end up with is questionable (DIV tags are all over the place, but it's almost all for styling and placement purposes), but it's possible.

Here's a simple skeleton XSLT script:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <!-- Identity transform template -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <!-- Template to match and remove unwanted elements (in this case, <div>), but preserve the children -->
  <xsl:template match="div">
    <xsl:apply-templates select="node()"/>
  </xsl:template>

  <!-- Template to match and replace one element with another, like, say, article with p (paragraph) -->
  <xsl:template match="article">
    <p>
      <xsl:apply-templates select="node()"/>
    </p>
  </xsl:template>

  <!-- Template to match and remove unwanted elements and their children (in this case, <script>) -->
  <xsl:template match="script">
    <!-- do nothing -->
  </xsl:template>

  <!-- Template to match the style attribute, and remove it from all elements. -->
  <xsl:template match="@style"/>
</xsl:stylesheet>

I don't know how to configure the proxy, so I can't help there, but if you can get the filtering to work, that skeleton should give you a start. You can use the xsltproc program to run the xslt script. That's a common program either bundled or readily available from package managers.

Let us know what you find out!
 
Back
Top