-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the XSSaaS wiki!
Create an account via the signup page and log in
From the portal click on the add function button.
- 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
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.
Once you submit you can see the management page which has instructions for how to call the function.
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.
To run functions in your browser open the worker page and press start.
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
- starting with x makes it use a multple of the worker's
-
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 thekey
parameter in the Call Function section.
An embeddable sdk is in the works, thus allowing you to add workers to your websites.
See tsdoc comments and code.