If you wish to utilize the VWR function flexibly, including for methods that demand traffic control, you can activate the VWR feature via an API in your source code.
API function descriptions
Surffy_Action
Surffy_Action(request URL, callback)
This function enables calling the entry request API, which triggers the waiting room.
Upon execution, the function requests the Surffy NetFUNNEL server to issue a ticket.
Apply this API for methods requiring traffic control.
- Code Template
Surffy_Action({Register URL for the segment}, function() {
// to do
});
Parameter
- url (string) *Required
- The web address for which you wish to regulate traffic. If it corresponds with the URL registered in the NetFUNNEL console, it will request access to the Surffy NetFUNNEL server. Otherwise, it will execute the callback function you provided as the second parameter without delay.
- callback (function) *Optional
- A callback function that executes when the NetFUNNEL Web Agent receives an entry response code. The function is executed promptly, notwithstanding whether the URL corresponds to the segment URL registered in the console.
- Sample
<script> const handleSubmitForm = (e) => { e.preventDefault(); console.log("submit"); // vaildity check logic if (document.test.userid.value == "") { ... return false; } // use method Surffy_Action(document.test.action, () => { document.test.submit(); }); }; </script> <form name="test" action="/test" onsubmit="return handleSubmitForm(event)"> <input type="text" name="userid" /> <input type="submit" value="login" /> </form>
Surffy_Complete
Surffy_Complete(request URL, callback)
Entry completion request API, which is used to end the wait and return the ticket.
If the entry was successful after waiting, the ticket will be returned automatically when the page refreshes. Therefore, it should only be used in exceptional circumstances, but if this is not the case (for example, if you are using a SPA framework that does not refresh on page change), you should call this function to handle the completion separately.
If the ticket is not rejected, it will be automatically rejected after the timeout set on the NetFUNNEL server.
Ticket return processing is required on receipt of an entry response code to prevent new entries from users being delayed during the timeout period.
Called without parameters when requesting basic control completion.
- Code Template
Surffy_Complete();
Call with parameters when requesting completion of section control.
To verify that the NetFUNNEL Web Agent has been successfully applied, please follow the steps below.
- Set the limited inflow of the basic control segment to '0'.
- Request an entry within the web page, depending on the method used (Basic Dynamic Traffic Control / API Direct Call / Main Page).
- Check if a waiting room appears on the screen. (VWR check)
- Check if there is a numerical change in the corresponding segment in the basic control menu of NetFUNNEL console. (EUM check).
Comments
0 comments
Please sign in to leave a comment.