From 1b3ca8a43b2fcd8611a88e3c90dc8abc7768c233 Mon Sep 17 00:00:00 2001 From: Earther Date: Tue, 24 Aug 2021 14:55:43 +0700 Subject: [PATCH] change bin file in package.json --- cli.js | 1 + index.js | 3 ++- package.json | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 cli.js 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",