Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

pingbackclient

7PH29ISC0.0.5TypeScript support: included

Send synchronized pingback requests. Ensure that pingback requests are processed by remote servers at a specific time.

pingback, wordpress, synchronized, concurrent, request, http, layer7, ddos, dos, spam, denial, service

readme

PingBackClient

Send synchronized pingback requests, to ensure pingback requests are processed at a specific time by the server.

This can be useful if you want multiple wordpress servers to process a pingback request at exactly one moment..

Example

This example will ask 'the-wordpress.fr' to process N http requests to the url: 'https://the-target.com'


// build configuration object for synchronized requests
const config: SyncRequestConfig = PingBack.getRequestConfig({
    /** url that will be fetched by the wordpress */
    target: 'https://target.com',

    /** wordpress informations */
    source: {
        /** link to an article */
        article: 'http://the-wordpress.fr/2018-06-12/an-article/',

        /** host on which to contact the xml rpc gate (default xmlrpc file: `http://${xmlRpcHost}/xmlrpc.php`) */
        xmlRpcHost: 'the-wordpress.fr'
    }
});

// nb of requests to make
const N: number = 10;

(async () => {
    // build requests objects
    let requests: SyncRequests = new SyncRequests();
    for (let i = 0; i < N; ++ i)
        requests.addRequest(config);

    // start pingback requests
    await requests.start();

    // terminate pingback requests
    await requests.terminate();
})();