Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPS Support? #9

Open
franklywatson opened this issue Sep 8, 2011 · 2 comments
Open

HTTPS Support? #9

franklywatson opened this issue Sep 8, 2011 · 2 comments

Comments

@franklywatson
Copy link

I was checking this out (very cool tool) for testing some HTTPS stuff were doing... I didn't see any explicit support for it mentioned anywhere, so I played around with the code and tried the quick and easy way of changing all the

require('http')

to

require('https')

However, connecting the clients to SSL seems not to work.. Has anyone done this or where else should I look?

Cheers

J

@jonjlee
Copy link
Collaborator

jonjlee commented Sep 9, 2011

J --

There's no built in support for https, unfortunately, but nodeload can handle them. You can use the 'https' node.js module with a custom requestGenerator function like this:

var https = require('https');
var readtest = {
        name: "Read HTTPS",
        timeLimit: 60,
        targetRps: 10,
        requestGenerator: function(client) {
            return https.request({method: 'GET', host: 'encrypted.google.com', port: 443, path: '/'});
        }
    },
    loadtest = nl.run(readtest);

You can also do this with nl.js using the -r option (see examples/test-generator.js).

The one caveat is that I don't believe node.js supports persistent connections over HTTPS (let me know if find something to the contrary), so this may skew your results. When generating a large amount of load, you might run into an issue where your request rate suddenly drops to zero for several seconds. This happens when the system runs out of ephemeral ports used for outbound connections, and node.js is waiting for old ports to be cleaned up for reuse. Let me know if see something like that, and we can see if there's a way to work around it.

@franklywatson
Copy link
Author

Hi Jon

That's great, looks like it works a charm! I've also been fiddling around with the report and would love to know how to modify the output to be CSV rather than JSON... It's not completely obvious to me what outputs this

Cheers

Jerome

JeremyFrederick pushed a commit to CozyOrchards/nodeload that referenced this issue Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants