Skip to main content
  1. Projects/

Multi-threaded Proxy server

·225 words·2 mins· loading · loading ·
Go tcp
Harish Sheoran
Author
Harish Sheoran
Engineer
Table of Contents

Multi-threaded Proxy server
#

A multi-threaded forward proxy server in Go using low-level socket connections to handle concurrent client requests efficiently.

  • Caching: Build in-memory LRU cache to store and serve frequently accessed response
  • Scalability: Integrated LRU cache with mutexes for thread safety and semaphore-based concurrency control (buffered channels) to manage request limits
  • Technical Stack: Go, HTTP, TCP/IP, Concurrency, Channels, Mutex.

🚀 Features
#

  • HTTP proxy Support
  • Concurrent request handling with semaphore limiting
  • Caching Strategy
    • In-memory LRU Cache
  • Handling request on TCP level

Source Code
#

harisheoran/multi-threaded-proxy-server

Muliti threaded proxy server with caching support.

Go
0
0

📺 Watch full demo
#

📂 Project Structure
#

├── app.go                    # contains server classes
├── go.mod                    # go module file
├── helper.go                 # helper functions
├── internal
│   └── cache
│       └── lru.go           # LRU cache implementation
├── main.go
├── proxy.go                  # proxy implementation

🛠️ Setup & Run
#

Clone the repository
#

git clone <repository-url>

cd multithreaded-proxy-web-server

Install Go dependencies
#

go mod tidy

Build the binary
#

go build -o bin/proxy .

Execute the binary
#

./bin/proxy -port=9000

now the proxy server is running on port 9000

Test Locally using Postman
#

First, setup proxy setting to port 9000 in postman application, and you are all good to send your requests.

To be implemented (open for contribution)
#

  • HTTPS support
  • Cache Invalidation policy ➜ multithreaded-proxy-web-server git:(main)

Related

Chat System: On-Premises Chat Application for Enterprises
·170 words·1 min· loading · loading
Go kafka redis
Introducing Chat System Enterprise, a cutting-edge, on-premises chat application designed specifically for companies that prioritize security, privacy, and control.
Scale Mesh: A better Vercel alternative
·414 words·2 mins· loading · loading
AWS Go Docker redis
Scale Mesh: A Vercel alternative.
Repoguard: Secure Your Repos, Manage Access Seamlessly.
·175 words·1 min· loading · loading
Go CLI
Repoguard is CLI tool built in Go language to monitor access of GitHub Repositories.