cfconnectingip

package module
v0.0.0-...-ef872fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 1 Imported by: 0

README

cf-connecting-ip

This repository contains a middleware for Go HTTP servers that sets the real IP of the client from the CF-Connecting-IP header, which is added by Cloudflare to HTTP requests coming through its services.

Overview

The middleware intercepts incoming HTTP requests and checks for the CF-Connecting-IP header. It then sets the RemoteAddr field of the request to the value found in this header, ensuring that subsequent handlers in the middleware chain will see the original client IP address, not the IP address of Cloudflare's proxy.

Installation

To install cf-connecting-ip middleware, use go get:

go get -u github.com/shigaichi/cf-connecting-ip

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRemoteAddr

func SetRemoteAddr(next http.Handler) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL