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

一套服务端和客户端,如何实现多个端口点对点http使用? #4685

Open
11 tasks
gowy222 opened this issue Feb 22, 2025 · 3 comments
Open
11 tasks

Comments

@gowy222
Copy link

gowy222 commented Feb 22, 2025

Describe the feature request

环境: 客户端:9000端口跑的vue,9001跑的nextjs项目,
这种前端path敏感,不适用于 https://gofrp.org/zh-cn/docs/features/http-https/route/ 路由功能

同一个客户端配置是否有办法不用公共的serverAddr 和serverPort ?

serverAddr = "XXX.XXX.XXX.XXX"
serverPort = 9000

[[proxies]]
name = "app-vue"
type = "http"
localPort = 9000
localIP = "192.168.66.1"
customDomains = ["XXX.XXX.XXX.XXX"]

而是变成

[[proxies]]
name = "app-vue"
type = "http"
serverAddr = XXX.XXX.XXX.XXX # 各自独立
serverPort  = 9000 # 各自独立
localPort = 9000
localIP = "192.168.66.1"
customDomains = ["XXX.XXX.XXX.XXX"]



[[proxies]]
name = "app-next"
type = "http"
serverAddr = XXX.XXX.XXX.XXX # 各自独立
serverPort  = 9001 # 各自独立
localPort = 9001
localIP = "192.168.66.2"
customDomains = ["XXX.XXX.XXX.XXX"]

这样实现一个客户端各自对应所需要的端口,
同时这种情况下,一个服务端如何配置开放9000和90001两个端口?
这样一来,扩展性,10个应用也只需要一套服务端和客户端

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
@KKKzzz7
Copy link

KKKzzz7 commented Feb 24, 2025

起两个client和serve程序不就解决了么

@gowy222
Copy link
Author

gowy222 commented Feb 26, 2025

起两个client和serve程序不就解决了么

目前就是堆数量的,但想着有没有更优解

@sowhyim
Copy link

sowhyim commented Mar 3, 2025

理论上是可行的,比如优先[[proxies]]里面配置的 server,当没有时,获取 global 的 server 配置,应当能满足你的要求

当然我还为读过该项目具体内容,不确定项目的思路是怎么样的😓

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

No branches or pull requests

3 participants