YanFrp/src/main/java/top/octopusyan/config/ProxyConfig.java

58 lines
1.3 KiB
Java
Raw Normal View History

2022-04-06 17:49:00 +08:00
package top.octopusyan.config;
import java.util.HashMap;
import java.util.Map;
/**
* @author : octopus yan
* @email : octopus_yan@foxmail.com
* @description : 代理设置
* @create : 2022-4-5 18:14
*/
public class ProxyConfig {
private static Map<String, String> serverPath = new HashMap<>();
private static Map<String, Integer> typePort = new HashMap<>();
static {
serverPath.put("香港", "xg.frp.octopusyan.top");
serverPath.put("北京", "bj.frp.octopusyan.top");
serverPath.put("上海", "frp.octopusyan.top");
typePort.put("http", 80);
typePort.put("https", 80);
typePort.put("ssh", 22);
typePort.put("tcp", 0);
}
public enum ProxyServer {
香港, 北京, 上海
}
public enum ProxyType {
HTTP("http"),
HTTPS("https"),
SSH("tcp"),
TCP("tcp"),
;
private String type;
public String getType() {
return type;
}
ProxyType(String type) {
this.type = type;
}
}
public static String getServerPath(String serverName) {
return serverPath.get(serverName);
}
public static Integer getTypePort(String type) {
return typePort.get(type);
}
}