diff --git a/cli.js b/cli.js old mode 100644 new mode 100755 index 12875f8..4cb8701 --- a/cli.js +++ b/cli.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node const WebSocket = require('ws'); const chalk = require('chalk'); const repl = require('repl'); diff --git a/index.js b/index.js index a378964..2006049 100755 --- a/index.js +++ b/index.js @@ -42,10 +42,11 @@ const tconsole = (options = {}) => { options = { host: "localhost", port: 8080, + ssl: false, ...options, } - ws = new WebSocket(`ws://${options.host}:${options.port}`); + ws = new WebSocket(`${options.ssl ? "wss" : "ws"}://${options.host}:${options.port}`); ws.onopen = () => { console.log('[TCONSOLE]: connected'); configure(ws); diff --git a/package.json b/package.json index 101218d..dfab950 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,7 @@ "description": "Console log to terminal", "type": "main", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "start": "node server.js" + "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git",