ReturnClientIP

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 3 Imported by: 0

README

Return Client IP

config example

# Static configuration

experimental:
  plugins:
    ReturnClientIP:
        moduleName: github.com/moonlightwatch/ReturnClientIP
        version: v0.1.0

# Dynamic configuration

http:
  routers:
    my-router:
      rule: host(`demo.localhost`)
      service: service-foo
      entryPoints:
        - web
      middlewares:
        - my-plugin

  services:
   service-foo:
      loadBalancer:
        servers:
          - url: http://127.0.0.1:5000
  
  middlewares:
    my-plugin:
      plugin:
        ReturnClientIP:
          Active: true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

Types

type Config

type Config struct {
	Active bool
}

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type MethodBlock

type MethodBlock struct {
	// contains filtered or unexported fields
}

func (*MethodBlock) ServeHTTP

func (m *MethodBlock) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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