x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Requirements for a HTTP proxy for mobile devices

Karpour Page Icon Posted 2022-01-07 2:48 PM
#
Avatar image of Karpour
Subscribers
H/PC Philosopher

Posts:
349
Location:
Austria
Status:
As C:Amie pointed out, Mozilla's Readability package works quite well on all kinds of websites, including HPC:Factor itself?

http://news.ohnitsch.net/read.php?url=https://www.hpcfactor.com

Something I've been wanting to do for a while is write a HTTP to HTTPS proxy, since there are barely any sites that a Jornada 720 will even connect to anymore these days.

But what if the proxy would not only allow connections to HTTPS sites, but also strip all unnecessary stuff out and downsize and convert all images?

My thinking was: Use NGINX to process each request, which forwards the url to a node app (Since Readabillity is JS, this makes the most sense)
The node app then makes the request.

If it's a HTML document, all the links will be replaced with http versions (It would be possible to have NGINX allow some ancient SSL version probably, but not worth the effort)
If it's an image, convert it to JPEG or GIF (I assume GIF might be better suited), downscale and serve

Ideally, there would be a way to also extract navigation links, not sure how well this would work as this is likely a lot harder than trying to guess which part of the website the actual text content is.

Anyway, if you have any ideas for this, let me know

Edited by Karpour 2022-01-07 4:56 PM
 Top of the page
null1024 Page Icon Posted 2022-01-11 9:37 PM
#
Avatar image of null1024
H/PC Newbie

Posts:
17
Location:
United States
Status:
Sounds like a great idea.
I've used WebOne in the past as an HTTPS proxy, had it running on my Pi 4 (it's a .NET program, so it should run fine on most things). It doesn't do everything you're interested in (in particular, it doesn't handle JS), but it does convert images to formats an HPC can read.
You might be able to combine or replace it with WRP, which basically renders the page in a modern browser on your home server and turns it into a clickable imagemap for your device, but I haven't tried it, least of all with an HPC. I think they support imagemaps though, I was browsing some older websites I'd found on wiby and I'm pretty sure I'd seen a few sites use 'em.

A custom solution might still end up being better, none of these options seem to be tailored at all for CE at all.
GIF has been way, way, way faster to decode than JPG on my HPC devices, even if you'd still have to take the color hit.
One other thing that'd be important is memory -- I've had pages that basically never finished loading with WebOne because of how big they were, even though they were like 90% text. You might want to look into being able to split pages up. Newer HPCs would be better off than the device I can actually hook up to the internet (an LG Phenom H-120F since I don't have the serial cable for my Jornada 680 or a way to use the modem).

Also, as an aside, doesn't it feel kinda goofy how much comparatively powerful hardware you end up needing to get an old device to be useful on the internet?
I'd had my full on gaming desktop running Windows 2000 in a VM with Mochasoft PPP so I could connect to the internet over serial on the Phenom, and I'd probably still want power like that if I used WRP since that runs a full copy of Chrome. Kinda also wonder if there's a different way other than using Mochasoft to get a serial internet connection that a CE device would like...
 Top of the page
stingraze Page Icon Posted 2022-01-11 10:44 PM
#
Avatar image of stingraze
Writing Team
H/PC Vanguard

Posts:
2,911
Location:
Japan
Status:
I found some clues in superuser.com.
https://superuser.com/questions/1487553/proxy-or-other-solution-that...








Edited by stingraze 2022-01-11 10:47 PM
 Top of the page
Karpour Page Icon Posted 2022-01-12 1:39 AM
#
Avatar image of Karpour
Subscribers
H/PC Philosopher

Posts:
349
Location:
Austria
Status:
Hm yeah there are several http to https proxy solutions, but even when that is solved, pages still need to be simplified for display on old devices, modern pages are simply too heavy, especially since the Jornada will likely even download the huge JS files (looking at you, react)

[Edit] Turns out that nginx can apparently also replace thing sin the html: https://serverfault.com/questions/713148/modify-html-pages-returned-...
So it'd be possible to both use it as http to https proxy and have it replace every occurence of https:// with http:// as well, handy!

Edited by Karpour 2022-01-12 2:02 AM
 Top of the page
stingraze Page Icon Posted 2022-01-12 3:04 AM
#
Avatar image of stingraze
Writing Team
H/PC Vanguard

Posts:
2,911
Location:
Japan
Status:
Quote
Karpour - 2022-01-12 10:39 AM
[Edit] Turns out that nginx can apparently also replace thing sin the html: https://serverfault.com/questions/713148/modify-html-pages-returned-...
So it'd be possible to both use it as http to https proxy and have it replace every occurence of https:// with http:// as well, handy!


Cool!

The data flow goes like this?:
Windows CE -> proxy -> website -> proxy -> minify / simplifer -> Windows CE

About the React.js, maybe that can be disabled and it can show only the barebones?

Edited by stingraze 2022-01-12 3:04 AM
 Top of the page
joval Page Icon Posted 2022-01-12 3:39 AM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
831
Location:
Northern California
Status:
Let me know when you have it up and running. I'd like to take it for a test drive!

joval
 Top of the page
stingraze Page Icon Posted 2022-01-12 9:21 AM
#
Avatar image of stingraze
Writing Team
H/PC Vanguard

Posts:
2,911
Location:
Japan
Status:
So, I experimented with the docker container of oldssl-proxy, it seems to be working, except I need to install a certificate on my Sigmarion 3, which I don't know how. I guess I must use the registry editor?

The experiment was as simple as doing the code below. I suggest doing on a experimentary / sandbox server.
docker run -d -p 3128:3128 -p 3180:3180 -v oldproxy-certs:/etc/squid/ssl_cert valdikss/oldssl-proxy

This is good for experiment, but I think it's better if I code the whole thing.

I am able to use the oldssl-proxy running on a docker container on my server, but since I don't have the certificate installed on my Sigmarion 3 (running Windows CE .NET 4.1), it's not working. All for now, if I can spend more time, I will update.

*note that I tried http & https, but not successfully yet.

-stingraze

Edited by stingraze 2022-01-12 9:29 AM




(proxy-ssl.jpg)



Attachments
----------------
Attachments proxy-ssl.jpg (184KB - 0 downloads)
 Top of the page
C:Amie Page Icon Posted 2022-01-12 9:47 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
16,018
Location:
United Kingdom
Status:
On 4.x it should be as simple as
Click Start
Settings
Control Panel
Certificates
Import
 Top of the page
stingraze Page Icon Posted 2022-01-12 10:42 AM
#
Avatar image of stingraze
Writing Team
H/PC Vanguard

Posts:
2,911
Location:
Japan
Status:
Thanks, I imported the OldSSL.crt, but now stuck with this:
I think connection to my server is ok, but something wrong with the certificate use or something I'm not familiar with.

I saw a popup of certificate in IE appear, but it went to the screen below.

-stingraze

Edited by stingraze 2022-01-12 10:50 AM




(proxy-ssl2.jpg)



Attachments
----------------
Attachments proxy-ssl2.jpg (144KB - 0 downloads)
 Top of the page
Jump to forum:
Seconds to generate: 0.253 - Cached queries : 21 - Executed queries : 57
Server Time now is: Thursday, 20 January 2022 - 10:25