Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Last active February 29, 2016 16:07
Show Gist options
  • Save sandrinodimattia/f60102ade16e521250dd to your computer and use it in GitHub Desktop.
Save sandrinodimattia/f60102ade16e521250dd to your computer and use it in GitHub Desktop.
Troubleshooting websocket connections in the Auth0 AD/LDAP Connector

This little script will test if you are able to connect to the AD/LDAP Connector endpoint with Websockets.

To run this:

  1. Save the file troubleshootws.js in your AD/LDAP Connector folder.
  2. Run: node troubleshootws
var WebSocket = require('ws');
var server = 'login.auth0.com';
console.log('Testing:', server);
var ws = new WebSocket('wss://' + server + '/lo/hub');
ws.on('open', function () {
console.log('Connection to hub %s.', 'succeeded');
ws.close();
}).on('message', function (msg) {
console.log('Message received: %s.', msg);
ws.close();
}).on('error', function (err) {
console.log('Connection to hub %s.', 'failed');
console.log(' > Body: %s', err);
ws.close();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment