Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: no X-Real-IP in http proxy #2743

Merged
merged 1 commit into from
Jan 9, 2022
Merged

doc: no X-Real-IP in http proxy #2743

merged 1 commit into from
Jan 9, 2022

Conversation

fakeboboliu
Copy link
Contributor

Since there's no X-Real-IP header set for the HTTP proxy, the doc seems wrong.

if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil {
// If we aren't the first proxy retain prior
// X-Forwarded-For information as a comma+space
// separated list and fold multiple headers into one.
prior, ok := outreq.Header["X-Forwarded-For"]
omit := ok && prior == nil // Issue 38079: nil now means don't populate the header
if len(prior) > 0 {
clientIP = strings.Join(prior, ", ") + ", " + clientIP
}
if !omit {
outreq.Header.Set("X-Forwarded-For", clientIP)
}
}

@fatedier fatedier merged commit e9775bd into fatedier:dev Jan 9, 2022
@fakeboboliu fakeboboliu deleted the dev-doc-xff branch January 13, 2022 03:21
github-actions bot added a commit to aiastia-dockerhub/frp that referenced this pull request Jan 26, 2022
* https://github.com/fatedier/frp: (60 commits)
  doc: update donation section (fatedier#2783)
  update release note
  version: bump to v0.39.0
  feat: support set local ip in client when connect server (fatedier#2774)
  move dial functions into golib (fatedier#2767)
  allow to disable application layer heartbeat to reduce traffic cost (fatedier#2758)
  update doc for Login operation
  server plugin: add client address in Login operation, fix fatedier#2742 (fatedier#2751)
  doc: no X-Real-IP in http proxy (fatedier#2743)
  ISSUE: 2730 Alpine version update for security fixes (fatedier#2731)
  add new sponsor (fatedier#2729)
  refactor: refine pkg net utils (fatedier#2720)
  update sponsor content
  update readme add sponsor pic (fatedier#2704)
  doc: add local_port for tcpmux example (fatedier#2695)
  remove authentication for healthz api (fatedier#2672)
  typo
  doc for v2 (fatedier#2648)
  e2e: add delay duration for monitor case
  bump version
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants