mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
feat: grpc / web get real ip
This commit is contained in:
@@ -4,7 +4,12 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const CtxKeyAuthorizedUser = "ckau"
|
||||
const (
|
||||
CtxKeyAuthorizedUser = "ckau"
|
||||
CtxKeyRealIPStr = "ckri"
|
||||
)
|
||||
|
||||
type CtxKeyRealIP struct{}
|
||||
|
||||
type Common struct {
|
||||
ID uint64 `gorm:"primaryKey" json:"id,omitempty"`
|
||||
|
||||
@@ -11,12 +11,14 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ConfigCoverAll = iota
|
||||
ConfigUsePeerIP = "NZ::Use-Peer-IP"
|
||||
ConfigCoverAll = iota
|
||||
ConfigCoverIgnoreAll
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Debug bool `mapstructure:"debug" json:"debug,omitempty"` // debug模式开关
|
||||
Debug bool `mapstructure:"debug" json:"debug,omitempty"` // debug模式开关
|
||||
RealIPHeader string `mapstructure:"real_ip_header" json:"real_ip_header,omitempty"` // 真实IP
|
||||
|
||||
Language string `mapstructure:"language" json:"language"` // 系统语言,默认 zh_CN
|
||||
SiteName string `mapstructure:"site_name" json:"site_name"`
|
||||
|
||||
Reference in New Issue
Block a user