This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import websocket | |
# Get auth token via POST to /api/v1/authTokens | |
# Use returned token to open a websocket connection to wss://host:port/events/v1 | |
# Token is passed as the URL parameter authToken | |
try: | |
self.logger.info("Getting auth token ...") | |
api_conn = api.ApiConnection(self.address, self.username, self.password, port=self.port) | |
response = api_conn.doPost("authTokens", {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from app import app | |
from flask_admin import Admin | |
from flask_admin.contrib.peewee import ModelView | |
admin = Admin(app, name='cdr-admin', template_mode='bootstrap3') | |
admin.add_view(ModelView(Record, db.session)) | |
app.run(host="0.0.0.0", port=8081) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP/1.1 200 OK | |
Date: Wed, 13 Feb 2019 18:21:15 GMT | |
Server: Apache | |
X-Frame-Options: DENY | |
Cache-Control: max-age=0, no-cache, no-store, must-revalidate | |
Pragma: no-cache | |
X-XSS-Protection: 1; mode=block | |
X-Content-Type-Options: nosniff | |
Strict-Transport-Security: max-age=31536000; includeSubDomains | |
Content-Type: text/xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WebSocket = require('ws'); | |
const util = require('util') | |
console.log("Starting...") | |
const ws = new WebSocket('ws://localhost:10000', | |
{ | |
rejectUnauthorized: false | |
}); |