新增自定义ssr订阅地址
修改http→https
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package com.yutou.tools;
|
||||
|
||||
import com.yutou.tools.other.tools;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ToolsApplication {
|
||||
public static final String version="1.4.4.1";
|
||||
public static final String version="1.4.4.4";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("当前版本号:" + version);
|
||||
|
||||
@@ -152,8 +152,13 @@ public class tools {
|
||||
@RequestMapping(value="/tools/clash/get.do",produces ="text/plain;charset=utf-8")
|
||||
public String getClash(){
|
||||
StringBuilder builder=new StringBuilder();
|
||||
String ssrUrl="https://s.sublink.me/subscribe/49191/IsXYcj95sGg/ssr/";
|
||||
String text= HttpTools.get("https://pub-api-1.bianyuan.xyz/sub?url="+ URLEncoder.encode(ssrUrl, StandardCharsets.UTF_8) +"&insert=false&config=https%3A%2F%2Fraw.githubusercontent.com%2FDarkatse%2FACL4SSR%2Fmaster%2FClash%2Fconfig%2FACL4SSR_Online.ini&target=clash");
|
||||
String ssrUrl=RedisTools.get("ssr");
|
||||
String url="http://127.0.0.1:25500/sub?target=clash&new_name=true&url="+URLEncoder.encode(ssrUrl, StandardCharsets.UTF_8) +"&insert=false&config=http%3A%2F%2Fgit.yutou233.cn%2Fyutou%2FACL4SSR%2Fsrc%2Fmaster%2FClash%2Fconfig%2FACL4SSR.ini";
|
||||
String text= HttpTools.get(url);
|
||||
if(text==null){
|
||||
System.out.println("ssr is Null = " + url);
|
||||
return "";
|
||||
}
|
||||
String[] tmp=text.split("\n");
|
||||
text=RedisTools.get("clash");
|
||||
builder.append("mixed-port: 7890").append("\n");
|
||||
@@ -174,6 +179,22 @@ public class tools {
|
||||
return builder.toString();
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("/tools/clash/ssr.do")
|
||||
public JSONObject setClashSSR(String url){
|
||||
RedisTools.set("ssr",url);
|
||||
JSONObject json=new JSONObject();
|
||||
json.put("msg","OK~");
|
||||
return json;
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("/tools/clash/getssr.do")
|
||||
public JSONObject getClashSSR(){
|
||||
JSONObject json=new JSONObject();
|
||||
json.put("code",0);
|
||||
json.put("data",RedisTools.get("ssr"));
|
||||
return json;
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("/tools/clash/list.do")
|
||||
public JSONObject clashList(){
|
||||
String text=RedisTools.get("clash");
|
||||
|
||||
@@ -72,7 +72,7 @@ public class userController {
|
||||
RedisTools.set("login", cc, 5 * 60 * 1000);
|
||||
String token = UUID.randomUUID().toString().replace("-", "");
|
||||
RedisTools.set(token, Tools.getRemoteAddress(request), 10 * 60 * 1000);
|
||||
String url = "http://tools.yutou233.cn/login/ban.do?token=" + token;
|
||||
String url = "https://tools.yutou233.cn/login/ban.do?token=" + token;
|
||||
Tools.sendServer("管理后台登录验证码", "本次登录验证码为:" + cc
|
||||
+ ",登录IP:" + Tools.getRemoteAddress(request)
|
||||
+ ",非正常登录,封禁IP:" + url);*/
|
||||
@@ -108,7 +108,7 @@ public class userController {
|
||||
RedisTools.set("ban", array.toJSONString());
|
||||
writer.write("已封禁");
|
||||
} else {
|
||||
String url = "http://tools.yutou233.cn/login/ban.do?token=" + token + "&model=yes";
|
||||
String url = "https://tools.yutou233.cn/login/ban.do?token=" + token + "&model=yes";
|
||||
String html = "<div><a href=" + url + ">click my is ban this IP :" + ip + "</a></div>";
|
||||
writer.write(html);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user