Created
November 24, 2011 14:34
-
-
Save ollieparsley/1391474 to your computer and use it in GitHub Desktop.
Very simple WebSocket load test script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Very simple load testing script | |
* | |
* It will open WebSocket connections and close them as soon as they are open | |
* | |
* Warning: This may crash your browser after a few minutes | |
* To stop the script just close the tab :p | |
*/ | |
//Place this into a script | |
setInterval(function(){ | |
var ws = new WebSocket('ws://<HOST_NAME_HERE>'); | |
ws.onopen = function(){ | |
ws.close(); | |
}; | |
}, 1); | |
//Or just put this into the address bar of your browser | |
javascript:setInterval(function(){var ws=new WebSocket('ws://<HOST_NAME_HERE>');ws.onopen=function(){ws.close();};},1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment