yacd icon indicating copy to clipboard operation
yacd copied to clipboard

面板的默认服务器连接添加当前网页的地址

Open cjwddtc opened this issue 4 years ago • 5 comments

就是面板通过clash的extern-ui启动的时候,默认的管理地址仍然是127.0.0.1:9090

是否可以通过js获取到当前href,如果href的path是/ui的话就替换默认的管理地址为前面的部分?

cjwddtc avatar Jan 10 '21 09:01 cjwddtc

yacd支持传参。把host,port,secret拼接上去就行了。

flyhigherpi avatar Jan 24 '21 00:01 flyhigherpi

@flyhigherpi 怎么传参有没有实例?我试了下?host=127.0.0.1&port=9090&&secret=xxx无效

AoEiuV020 avatar Apr 02 '21 03:04 AoEiuV020

不是这意思吧,比如clash跑在路由器上,电脑请求路由器yacd地址192.168.1.1:9090/ui,然后yacd自动连接了 127.0.0.1:9090这当然连不上了,不管clash怎么配置都是没用的,clash压根不在电脑上,

xtoys @.***> 于 2021年9月5日周日 01:24写道:

试试这样 ?

external-controller: 0.0.0.0:9090

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haishanh/yacd/issues/559#issuecomment-913009146, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZEDFV5E4GCKKPKF5L4FJLUAJI5XANCNFSM4V4IWH6Q .

AoEiuV020 avatar Sep 04 '21 20:09 AoEiuV020

@cjwddtc 用腳本,啓動前暴力改html?

Un1Gfn avatar Nov 13 '21 14:11 Un1Gfn

@Un1Gfn 不至于,已知直接添加一个localStore就可以,只是希望官方js能主动支持个更方便的方法,

localStorage['yacd.haishan.me'] = '{"clashAPIConfigs":[{"baseURL":"http://127.0.0.1:9090","secret":"password","addedAt":0}]}'

AoEiuV020 avatar Nov 13 '21 17:11 AoEiuV020