惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
The Cloudflare Blog
量子位
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
D
DataBreaches.Net
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
U
Unit 42
博客园 - 聂微东
有赞技术团队
有赞技术团队
A
About on SuperTechFans

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building a Forward Proxy in Go with Middleware and Auth
SalzDevs · 2026-05-15 · via DEV Community

SalzDevs

I’ve been building Groxy, a pre-v1 Go library for creating forward proxy servers.

It supports:

  • HTTP forwarding
  • HTTPS CONNECT tunneling
  • middleware
  • blocking/body transforms
  • access logs
  • proxy authentication
  • opt-in HTTPS inspection

Minimal proxy

proxy, err := groxy.New(groxy.Config{
   Addr: "127.0.0.1:8080",
})
if err != nil {
   log.Fatal(err)
}

log.Fatal(proxy.Start())

Enter fullscreen mode Exit fullscreen mode

Try it:

curl -x http://127.0.0.1:8080 http://example.com
curl -x http://127.0.0.1:8080 https://example.com

Enter fullscreen mode Exit fullscreen mode

Middleware

proxy.Use(
   groxy.AddRequestHeader("X-From-Groxy", "true"),
   groxy.AccessLog(log.Default()),
)

Enter fullscreen mode Exit fullscreen mode

Proxy auth

  proxy.Use(groxy.ProxyBasicAuth("admin", os.Getenv("PROXY_PASSWORD")))

Enter fullscreen mode Exit fullscreen mode

Or:

 proxy.Use(groxy.ProxyBasicAuthFunc(func(username, password string) bool {
    return users.Verify(username, password)
}))

Enter fullscreen mode Exit fullscreen mode

Auth protects both HTTP proxy requests and HTTPS CONNECT tunnels.

HTTPS inspection

By default, HTTPS is tunneled normally.

Inspection is explicit opt-in:

HTTPSInspection: &groxy.HTTPSInspectionConfig{
    CA:        ca,
    Intercept: groxy.MatchHosts("example.com", "*.example.com"),
 }

Enter fullscreen mode Exit fullscreen mode

Only inspect traffic you own or are authorized to inspect.

Feedback wanted

Groxy is pre-v1, so I’m looking for API/security feedback before stabilizing it.

Repo: https://github.com/SalzDevs/groxy
Docs: https://pkg.go.dev/github.com/SalzDevs/groxy