-
Simple programm needed
I am in need of a program that opens a specified number of TCP/Ip winsockets and runs a cgi, or a php....dont know but i think i would need to submit a cookie with each winsock connection.
This wouldnt be too difficult if I had some programming skills. But i am powerless in the world of programming.
Any help would be appriciated....
-
Hmm, you want to stress-test a web-application?
-
When you say you 'need to run a cgi or a php,' do you mean you want to read websites that are composed using cgi or php, or do you want to compose those websites yourself?
-
Take a cgi script.....copy to clip board...paste in address bar. Click go, and it will run that CGI.
I want to do this without opening my browser. and like 50 sockets at a time.:)
-
Here is a solution for you: Put your cgi on a web-server that resides on one machine. Then start up WebLoad on another machine that is connected to the web-server. The WebLoad program will simulate users by using simple javascript created by a wizard. You say you want 50 simultanious users, well be prepared to run at least a dual-processor on the server. If the cgi's do much work, that is.
Hope this helps.
-
I think this would do the trick too. Save this in a file called TryUrl.java, compile it, and run it.
I'm no java expert - maybe someone can check my code?
Code:
import java.net.URL;
import java.io.InputStream;
public class TryUrl {
public static void main (String[] args) {
// this opens 6 threads, add more if desired...
new SimpleThread("Thread 1").start();
new SimpleThread("Thread 2").start();
new SimpleThread("Thread 3").start();
new SimpleThread("Thread 4").start();
new SimpleThread("Thread 5").start();
new SimpleThread("Thread 6").start();
}
}
class SimpleThread extends Thread {
URL inUrl;
InputStream stream;
public SimpleThread(String str) {
super(str);
}
public void run() {
try {
inUrl = new URL("http://www.yoursite.com/index.php?withsomevariable=thisvalue");
stream = inUrl.openStream();
System.out.println("DONE! " + getName());
} catch (Exception e) { System.out.println("ERROR! " + e); }
}
}
-
I need to take a programming class...thats all there is to it....