Encoding (Advanced)
Encoding is useful to prevent extension blockers from blocking your requests. It’s useless for network filters when making an interception proxy, since you intercept the requests and responses on the client and not the server, however extension filters can block your requests before they reach the SW.
Types of effective encoding for proxies
Section titled “Types of effective encoding for proxies”The advantage of XOR encoding is that you can cypher. See this site for an explanation.
Base64
Section titled “Base64”Base64 is simple and you can use native APIs.
How to implement
Section titled “How to implement”- Add encode and decode methods to your configuration.
- Have these stringified when sent to the SW via your Controller APIs, as we discussed in Getting Started.
- Have your codebase use these methods defined on the config. Remember to eval the stringified version on the SW with
new Function()
, for when decoding in the SW, and then stringify it again for the injects.