Well, better not encode the URL to base64.

Try do something like encodeURIComponent() instead:

```

> encodeURIComponent("https://google.com") 'https%3A%2F%2Fgoogle.com'

```

You may add a switch to "request directly on failure" for that case.

[Still it may be useful for certain end users as compressor proxies are self host-able nowadays like https://github.com/Yonle/bandwidth-hero-proxy (for Bandwidth Hero browser addon)]

Reply to this note

Please Login to reply.

Discussion

Yep we tested the basic url encoder with imgproxy for 4 months last year. Things would break so much that I had to move to their base64 version of it. Then I discovered that half of the formats weren't getting reduced in size and gave up :(

https://github.com/imgproxy/imgproxy

It has to be something that works 100% of the time and when it doesnt, there has to be a way to alert the user that their proxy service sucks. Otherwise, it's going to rain complains on our emails.

We probably need to teach people to add a caching server or a CDN in front of the proxy, otherwise processing compressions can get really expensive, even for single user servers.

Especially for country under censorship,for instance,China.

It's always depending on their services. Yep. Could admit tho.

Wouldnt be better if a third party proxy app intercepted all app communications and made images go to their own proxy server?

That's complicated. Almost impossible to do when it's using TLS.

Are you sure? Orbot seems to be able to redirect everything through Tor, Tls included.

I mean modifying the incomming data to change the URL of the request.

Some images are best compressed to webp in lossy mode. I tried converting to other format but it ended up way slower & heavier than the normal image.

Compressing it to monochrome did reduce the image size tho.

Colored:

So far using this with bandwidth hero addon is doing great.