I’m trying to a create a fully functional web proxy using node.js which essentially downloads the webpage and displays it to the client. I’m having a problem implementing cookies though as it’s harder than I thought since they have so many rules.
Are there any libraries that have been already made to emulate how a browser handles cookies?
Use request, it already handles storing the cookies for consecutive requests in a cookie jar.
Or if you don’t want to reinvent the wheel use node-http-proxy from Nodejitsu for a full blown proxy.