Posts on Basit's Blog https://blog.rjbasitali.com/posts/ Recent content in Posts on Basit's Blog Hugo -- gohugo.io en-us Basit Ali Tue, 12 Oct 2021 22:05:04 +0500 Writing your own Reverse Proxy server using Golang https://blog.rjbasitali.com/posts/writing-your-own-reverse-proxy-using-golang/ Tue, 12 Oct 2021 22:05:04 +0500 https://blog.rjbasitali.com/posts/writing-your-own-reverse-proxy-using-golang/ Writing a Reverse Proxy server in Go is a matter of single digit lines of code due to its rock solid standard library and its low level network plumbing capabilities. Recently I came across some use cases where I needed to write my own Reverse Proxy server and of course Go was the pragmatic choice. Let us first start with defining Reverse Proxy and its common uses. Reverse Proxy A Reverse Proxy is an intermediary server that sits between multiple clients and servers, and directs client requests to appropriate backend server. Writing a Middleware for your HTTP handler – Golang https://blog.rjbasitali.com/posts/writing-a-golang-middleware-for-your-http-handler/ Sun, 01 Aug 2021 22:05:04 +0500 https://blog.rjbasitali.com/posts/writing-a-golang-middleware-for-your-http-handler/ If you are a backend developer working daily with HTTP requests then you have most likely already encountered situations where you want a common functionality across all the incoming HTTP requests, which can be as simple as checking if the Content-Type header only has the value application/json if you only support json, or maybe you want to spoof your HTTP request to change the method type from POST,GET or PUT to something else based on the X-HTTP-Method-Override header, or of course authenticate before finally passing the request to the destination HTTP handler.