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

frpc: support metadatas and annotations in frpc proxy commands #4623

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Conversation

fatedier
Copy link
Owner

@fatedier fatedier commented Jan 6, 2025

WHY

Fix #4440

@fatedier fatedier requested a review from Copilot January 6, 2025 06:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

pkg/config/flags.go Show resolved Hide resolved
@fatedier fatedier merged commit 27db621 into dev Jan 6, 2025
2 checks passed
@morph027
Copy link

morph027 commented Jan 6, 2025

Wow, thank you 🫶

@morph027
Copy link

morph027 commented Jan 6, 2025

Just created a test build from dev and it looks like the metadatas are not being passed to the server.

Client:

frp/bin/frpc http -s <server> -d <domain> --user <user> --metadatas token=<token>
2025-01-06 18:30:55.728 [I] [client/service.go:295] try to connect to server...
2025-01-06 18:30:55.811 [E] [client/service.go:280] send Login request to plugin error
2025-01-06 18:30:55.811 [W] [client/service.go:298] connect to server error: send Login request to plugin error
login to the server failed: send Login request to plugin error. With loginFailExit enabled, no additional retries will be attempted

Server plugin shows the following payload and therefore is unable to validate the token.

{
  "version": "0.61.1",
  "os": "linux",
  "arch": "amd64",
  "user": "<user>",
  "privilege_key": "3a108ca101d3bea67f6892ec6ee7e82a",
  "timestamp": 1736184655,
  "client_spec": {},
  "pool_count": 1,
  "client_address": "<client-ip:client-port>"
}

@fatedier
Copy link
Owner Author

fatedier commented Jan 7, 2025

It's metadata for proxy, not for client.

Command-line arguments are not very convenient for expressing complex hierarchical structures, so supporting client metadata may not be considered.

github-actions bot added a commit to aiastia-dockerhub/frp that referenced this pull request Jan 7, 2025
* https://github.com/fatedier/frp:
  frpc: support metadatas and annotations in frpc proxy commands (fatedier#4623)
  Fix typos (fatedier#4615)
  client, pkg, server, test: replaced 'interface{}' with 'any' (fatedier#4611)
  Update stale workflow (fatedier#4600)
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.

[Feature Request] add metadatas to frpc proxy commands
2 participants