Skip to content

Commit fe43c92

Browse files
committed
随机ip范围调整
1 parent 2e71c83 commit fe43c92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/cn/jja8/newbinggogo/NewBingGoGoServer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public static NanoHTTPD.Response goUrl(NanoHTTPD.IHTTPSession session,String str
141141
//添加X-forwarded-for
142142
urlConnection.addRequestProperty(
143143
"X-forwarded-for",
144-
getRndInteger(1,5)+"."+getRndInteger(1,255)+"."+getRndInteger(1,255)+"."+getRndInteger(1,255)
144+
getRndInteger(3,5)+"."+getRndInteger(1,255)+"."+getRndInteger(1,255)+"."+getRndInteger(1,255)
145145
);
146146

147147
//建立链接
@@ -190,7 +190,7 @@ public static NanoHTTPD.Response goUrl(NanoHTTPD.IHTTPSession session,String str
190190

191191
//生成随机数
192192
public static int getRndInteger(int min, int max) {
193-
return (int) (Math.random() * (max - min + 1) + min);
193+
return (((int)(Math.random() * (max-min))) + min);
194194
}
195195

196196
public static WebSocket getReturnErrorWebSocket(IHTTPSession session,String error){

0 commit comments

Comments
 (0)