Skip to content
Dustin Van Tate Testa edited this page Feb 3, 2023 · 7 revisions

Welcome to the XSSaaS wiki!

Table of Contents

Deploying a function

Make account

Create an account via the signup page and log in

Create function

From the portal click on the add function button.

Fill in the required information

  • Name and description can be any values that make it easy for you to remember the function
  • Use only workers associated with this account makes the function private to increase security
  • Avoid reusing workers may be useful if you are attempting to avoid IP ratelimits
  • Additional filters/policies are available upon request

Upload all assets

You must upload a file named index.js with a callable default export. See the example below:

/**
 * Default export gets called by web worker thread
 * @param arg {string} additional data provided by the caller
 * @param utils {TaskUtils} tools
 */
export default async function (arg, utils) {
    utils.log(`Function called with argument '${arg}'`);
    console.log('hello hello');
}
  • The arg parameter is a string containing data provided by the caller.
  • The utils parameter is an object containing some relevant tools (see inline documentation for class TaskUtils).
  • You can add more assets and import() their relative paths.

Feel free to check out TypeScript demo.

Submit

Once you submit you can see the management page which has instructions for how to call the function.

Calling a Function

Function Management Page

Each function has it's own manage page which can be found by clicking on the manage button from the portal. This page has a section titled "Call Function" with instructions on how to call your function. This is done by sending an HTTP POST request to the provided url with any additional argument data being provided by the request's body. For example this could be done by the following JavaScript code.

fetch('https://xss.software/api/work/task/<function_id>?key=<auth_token>', {
    method: 'POST',
    body: '<here goes some additional data that gets passed to the function>',
});
  • The mime type for the body will be interpreted as text/plain. Please encode accordingly.

Running Functions

Worker page

To run functions in your browser open the worker page and press start.

GET parameter options

The following can be added to the url to change the worker behavior. This makes it easy to for example automate opening worker sessions on many computers.

  • start: this makes the worker session start without user interaction (ie - xss.software/worker/?start)
  • n: set number of threads to use
    • starting with x makes it use a multple of the worker's navigator.hardwareConcurrency
    • starting with a '-' makes it use all threads except the number after the -
    • starting with a '+' makes it use all threads with the number after the + being overloaded
    • rember to do encodeURIComponent
  • authToken: to prevent having to log in you can pass your authToken via the url. This can be obtained from the function manage page as the key parameter in the Call Function section.

Embedded Workers

An embeddable sdk is in the works, thus allowing you to add workers to your websites.

Additional documentation

See tsdoc comments and code.