Targets

Each test case has to have at least one target. A target specifies the endpoint you want to test primarily to prevent you from accidental sending traffic to an unwanted system. The targets must be publicly reachable via HTTP by our clusters.

A target has to be a valid hostname. If provided with an URL, we will extract the hostname from it and ignore the rest. The following examples are referring to the same target:

// Valid targets definitions
definition.addTarget("api.example.com");
definition.addTarget("http://api.example.com:8080");
definition.addTarget("https://api.example.com/path/to/resource");

NOTE: Only the hostname is relevant for validation, but you may define a protocol and port to make us of relative URLs.

Requests to endpoints not defined as a target will be denied. Learn more about specific errors in our Other Errors and Events section.

Defining Targets

You can provide targets using definition.addTarget(), definition.setTarget() or definition.setTargets() as follows:

definition.addTarget("https://api.example.com");
definition.addTarget("https://api2.example.com:8081");
// or
definition.setTarget("https://api.example.com");
// or
definition.setTargets(["https://api.example.com", "https://api2.example.com:8081"]);

Please note that the last two variants overwrite any previously specified targets.

NOTE: If you define multiple targets, you need to specify the full URL as part of your request:

definition.session("index", function(session) {
  session.get("https://otherapi.example.com/index");
});

Defining HTTPS targets

StormForger assumes a HTTP target if no protocol is specified. If you want to test a HTTPS target, you have to specify the https:// protocol in the target or use full URLs for all request definitions.

Relative URLs

If you define only one target in your test case, you can drop the hostname in your URLs:

definition.setTarget("https://api.example.com");
definition.session("index", function(session) {
  session.get("/index");
});
Icon Support Are you stuck? Or do you have any feedback? Get in touch with us – we are happy to help you.
Icon Schedule a demo Schedule a personal, customized demo. We'll show you around and introduce you to StormForger.
Icon Talk to a human To build and run reliable applications is complex – we know. Schedule a call and we’ll figure things out.

We are using cookies to give you the best online experience. If you continue to use this site, you agree to our use of cookies. By declining we will disable all but strictly required cookies. Please see our privacy policy for more details.


Accept Decline