Simple programm needed
Results 1 to 7 of 7

Thread: Simple programm needed

  1. #1
    AntiOnline Senior Medicine Man
    Join Date
    Nov 2001
    Posts
    724

    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....
    It is better to be HATED for who you are, than LOVED for who you are NOT.

    THC/IP Version 4.2

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Posts
    472

    Question

    Hmm, you want to stress-test a web-application?
    ---
    proactive

  3. #3
    Hi mom!
    Join Date
    Aug 2001
    Posts
    1,103
    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?
    I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.

  4. #4
    AntiOnline Senior Medicine Man
    Join Date
    Nov 2001
    Posts
    724
    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.
    It is better to be HATED for who you are, than LOVED for who you are NOT.

    THC/IP Version 4.2

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Posts
    472
    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.
    ---
    proactive

  6. #6
    Hi mom!
    Join Date
    Aug 2001
    Posts
    1,103
    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 wish to express my gratitude to the people of Italy. Thank you for inventing pizza.

  7. #7
    AntiOnline Senior Medicine Man
    Join Date
    Nov 2001
    Posts
    724
    I need to take a programming class...thats all there is to it....
    It is better to be HATED for who you are, than LOVED for who you are NOT.

    THC/IP Version 4.2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •