About, oh 6 years back, I had a bit of an issue. I had a nice little front-end website that was actually just documentation for software my employer had. I was asked to enhance it in some ways, one of them being adding interactive menus so a user could switch between languages, versions, and modules. And a nice little feedback form to top it all off.
But the problem was that I couldn’t do this processing on the same server,While I did have php
installed, it did not have a database nor could I add anything else to it. But then, JavaScript doesn’t like doing AJAX requests to another server. It complains about cross-site security. And, to be honest, I was still somewhat of a newbie when it comes to web servers, and front-end javascript. Sure I knew how to code, but the networking was little alien to me. In reality, had I not been such a noob I would have had 2 actual solutions: first, learn how to properly do cross-site requests using callbacks which probably would have been the simplest. Second, I could have just created a reverse proxy to redirect queries to my back-end server… But my brain went in a completely different direction: I created a proxy of my own, using php, which took the request and forwarded it to the backend, then took the response and threw it back to my front-end. I can hear some pros laughing at so many things in this in this description. C’mon a simple CORS request fixed using a custom PHP proxy, that’s ludicrous! But, I had little guidance, and I couldn’t find the right words that would tell Google to give me the correct information. So I digressed. Now, I’m a pretty big proponent for free exchange of information which includes most of the code I write in my life. So I put that shitty proxy thingy the now defunct Google Code, later to move it to Github. And wouldn’t you know it, that damn thing is still the most popular repository I have, with the only exception being the Komada framework (Which is actually now under a github organization, actually). With 60 Stars and 56 Forks, it sits comfortably at the top of my Github profile page. And, while I don’t maintain it anymore, I’m sure one of those forks is being maintained somehow! Go check out php-transparent-proxy and have a laugh at my ridiculous solution to a simple problem <3