mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2922] [Feature Request] Access FRP groups by username #2331
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#2331
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @roeeklinger on GitHub (May 1, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2922
Describe the feature request
In FRP, I can define TCP load balancing groups as follows:
This way when I make a request to FRPS on port 80, it will load balance to memebers in group1, and if I make a request on port 90, it will load balance to members on group2.
However, I have a need for many groups, a few hundred, and this forces me to open a few hundred ports on my FRPS, which can be problematic in many cases.
For security and scalability, it would be better if we can accept the traffic on FRPS on a single port, and then select the group based on an HTTP username, or some other similar parameter.
For example, I can configure FRPC members as such:
This way, I can simply run this to get to group1:
curl -x 'http://my_username1:my_password@url-of-frps:80' 'https://ipinfo.io'or run this to get to group2:
curl -x 'http://my_username2:my_password@url-of-frps:80' 'https://ipinfo.io'This would allow us to select any group needed, using only one port.
As far as I am aware, this is currently impossible using existing configurations, please correct me if I am wrong.
Describe alternatives you've considered
It might be possible to use a Squid proxy server before connecting to FRPS, Squid will add an outgoing TOS or NFMARK to the outgoing request, which will go to FRPS. Then, on FRPS side, we can use the TOS or NFMARK and some routing rules to route the request to the right port on FRPS.
This is a hackish solution that requires a lot of work on 2 separate services and is not elegant, furthermore, it forces us to use Squid proxy before the FRPS installation.
Affected area
@fatedier commented on GitHub (May 2, 2022):
You can try
tcpmuxproxy https://github.com/fatedier/frp#tcp-port-multiplexing@roeeklinger commented on GitHub (May 2, 2022):
@fatedier Thanks, I followed the README file, this is my configuration:
I have a transparent forward
Squid proxy serverrunning onport 4301onfrpc.I make a request like so:
but no matter what I do I am getting an empty reply from the server, and FRPS and FRPC show no new log output at all, am I using it wrong?
@fatedier commented on GitHub (May 3, 2022):
You should send
HTTP Connectrequest. Please search google for more information.@roeeklinger commented on GitHub (May 3, 2022):
@fatedier Oh you are right, I missed the part where it has to be CONNECT. Because I did not specify --proxytunnel or https:// it used GET instead, if I specify them it seems to work:
However, on the FRPS side I get:
[D] [vhost.go:158] http request for host [ipinfo.io] path [] not foundThis seems to happen since the request that is sent is
CONNECT ipinfo.io:80 HTTP/1.1and notCONNECT test1 HTTP/1.1, since if I make a request like this, it does seem to work:output on frps:
However, of course, Squid doesn't know how to handle this request, since the request is for
test1.x.x.x.x.com, my question is, is this option only good for web servers or can I somehow use it for upstream proxies as well?@github-actions[bot] commented on GitHub (Jun 3, 2022):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.