This example shows how you can ping a server to detect whether Cockpit is available there from a web browser. Your browser must support CORS.
Server: Go