Created
November 26, 2011 15:31
-
-
Save bnoordhuis/1395863 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /bigfile |
This file contains hidden or 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
| #!/bin/sh | |
| dd if=/dev/urandom of=bigfile bs=1024 count=1024 |
This file contains hidden or 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
| fs = require('fs'); | |
| https = require('https'); | |
| var options = { | |
| key: fs.readFileSync('ssl-insecure.key'), | |
| cert: fs.readFileSync('ssl.crt') | |
| }; | |
| // file must be more than 100k; I tested with 620k file | |
| var bigFile = fs.readFileSync('bigfile'); | |
| var server = https.createServer(options, function (req, res) { | |
| res.writeHead(200, { | |
| 'Content-Length': bigFile.length | |
| }); | |
| var stream = fs.createReadStream('bigfile', {}); | |
| req.emit('static', stream); | |
| stream.pipe(res); | |
| // the following code works well: | |
| //res.write(bigFile); | |
| //res.end(); | |
| }); | |
| server.listen(3000); |
This file contains hidden or 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
| #!/bin/bash | |
| for i in {1..10}; do wget --no-check-certificate -O download.dat https://localhost:3000/; done |
This file contains hidden or 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
| -----BEGIN RSA PRIVATE KEY----- | |
| MIICXQIBAAKBgQCx7K+mV6b6o4qEreMQ5QsZLW0vNhk0TfPwfdIkxvQh4N+a6CH3 | |
| aGha9dhP/V2Gs1xcmq444aINiv/oQQoh6rtuZEh+H8utf8us90EjkquC5kA2NwVj | |
| Oy5o3bqlv4oC6EsZi3TeamHV3w1z8vzai29MmT1DTojEiCSjxtYl79fxYQIDAQAB | |
| AoGAadu4Ze+gmV7T+zy57ENZ5xDv9TbqqAP5LwytCtSUS9PPNgsGqnykGfpLSMwl | |
| 6Q6t1SrynUUhdY1N1JFdxfAysu09zYcFve5qF4fVyuk/sRywR3Rs1kAuTo2BGyBG | |
| dZ6w1ho0hCiPPy3nt3OMPh5P4c6tgfvu2XPeQUgRO0fS7wECQQDcqNWWayImNCIZ | |
| L1bJkavZc8YmYOhlW3gNMkD/XtWcsQRXWIioPh1f7vI9XKay2iEh5qFMrM5RJEEy | |
| C9aXUIMdAkEAzmuxv8UloxKDgGKQLftO7r726irD3NUMyN3YZgcbZ0q9oHMdXgHY | |
| PVB5Vjf8GgpL72luk8OpF6WXKxinNfrwFQJACia+RMBC/uzxEKWL4ZQRCtz3pbZZ | |
| mqgdmsXQFa+ANkgyge4xw0OwSESO4mHLzXiZg5y/mO5uQ29ejHXc9nMexQJBAJOR | |
| oi06v8FpBuHNlM2Kj89WbibSE9vX45/mGUI3anvZjt8Z7LC8GN8cnOHqfCwRmF+7 | |
| u/WfN09UblG8+i05DFECQQDQLy7AQ0/YaFRIX4+F7Ha20LZeOQAbexBEvf86xLEe | |
| v+cA5KTvwzc8362cdIh4wjhnyhzFmdwY22yqBkExU0GG | |
| -----END RSA PRIVATE KEY----- |
This file contains hidden or 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
| -----BEGIN CERTIFICATE----- | |
| MIICATCCAWoCCQD478diKE962TANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB | |
| VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 | |
| cyBQdHkgTHRkMB4XDTExMTEyNDE0NTIyNVoXDTExMTIyNDE0NTIyNVowRTELMAkG | |
| A1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0 | |
| IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAseyv | |
| plem+qOKhK3jEOULGS1tLzYZNE3z8H3SJMb0IeDfmugh92hoWvXYT/1dhrNcXJqu | |
| OOGiDYr/6EEKIeq7bmRIfh/LrX/LrPdBI5KrguZANjcFYzsuaN26pb+KAuhLGYt0 | |
| 3mph1d8Nc/L82otvTJk9Q06IxIgko8bWJe/X8WECAwEAATANBgkqhkiG9w0BAQUF | |
| AAOBgQBX/sgBdTKitzGyeUZLLuw2McEOpZgzj7WcrnNVIq1WPSYvIYcBfPqo5eiv | |
| WfC2JMK+genivTNAt8Zy4RmcDgBbH1HlrIUGJxvrmWFNRxh/FZ5Dg/P3Jf4vDjub | |
| prvnZYmCJyGbDrdCmqLD4nHxOQh5xvmSP8Rg8CfPAVex6ntEbw== | |
| -----END CERTIFICATE----- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment