huggingface / frp

FRP Fork
Apache License 2.0
138 stars 19 forks source link

Using a custom address #6

Open lcombaldieu opened 9 months ago

lcombaldieu commented 9 months ago

Hi,

I would like my frp to generate custom links for my demos. For example, launching an interface would produce links such as : demo1.my-website.com demo2.my-website.com Instead of qsdcjbqosqsdcq.my-website.com

Is this possible ? Where could I tinker in the code ?

cpwan commented 9 months ago

here is where the random prefix is generated. still trying to figure out how to change that...

https://github.com/huggingface/frp/blob/b10131fda49c673c7aeaf604377051521cdc2334/server/control.go#L465

lcombaldieu commented 9 months ago

I have opened a pull request with a solution using env variable to set the custom name.

See the code here

ckasimis commented 9 months ago

great work!

how about generating a custom proxyname that can relate to the script that is launched? for example:

chat.my-website.com sdxl.my-website.com mistral.my-website.com llama.my-website.com

how could we pass that variable

lcombaldieu commented 9 months ago

Nice idea ! However I think for this kind of feature to work, a bit more engineering is required on Gradio's side. You would need to add changes to gradio's python lib and the frp repo. Maybe @abidlabs can help for this.

Frank-Jie commented 8 months ago

I have opened a pull request with a solution using env variable to set the custom name.

See the code here

thanks for your work, it save me a lot of time . but it seems only change the rule of proxyName on the server side.

frpc need to be correspond with same rule here: https://github.com/huggingface/frp/blob/dev/client/proxy/proxy_manager.go#L137

lcombaldieu commented 8 months ago

I'm still having trouble making it work. If anyone with more expertise with go and frp can review the pull request, that would be helpful.

@Frank-Jie did you manage to do it ? I would be interested in your solution