New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

svrx-plugin-localtunnel

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svrx-plugin-localtunnel - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

57

index.js

@@ -1,2 +0,1 @@

const localtunnel = require('localtunnel');

@@ -7,41 +6,53 @@

configSchema: {
subdomain: {
type: 'string',
description:
'A string value requesting a specific subdomain on the proxy server',
'A string value requesting a specific subdomain on the proxy server'
},
localhost: {
type: 'string',
description: 'Proxy to this hostname instead of localhost',
description: 'Proxy to this hostname instead of localhost'
},
host: {
type: 'string',
description: 'use your own localtunnel server, defualt is "https://localtunnel.me"',
},
description:
'use your own localtunnel server, defualt is "https://localtunnel.me"'
}
},
hooks: {
async onCreate({ io, config, events, logger }) {
async onCreate({ config, events, logger }) {
let tunnel;
events.on('ready', ()=>{
events.on('ready', () => {
const stopSpin = logger.spin('connecting to localtunnel...');
const port = config.get('$.port');
tunnel = localtunnel(port, {
host: config.get('host'),
local_host: config.get('localhost'),
subdomain: config.get('subdomain'),
}, (err, tunnel)=>{
if(err) logger.error(`localtunnel setup failed, beacuse {err.stack || err.message}`)
logger.notify(`url is available on ${tunnel.url}`)
})
tunnel.on('error', (err)=>{
logger.error(err.message)
})
})
const { chalk } = logger;
tunnel = localtunnel(
port,
{
host: config.get('host'),
local_host: config.get('localhost'),
subdomain: config.get('subdomain')
},
(err, tunnel) => {
stopSpin();
if (err)
logger.error(
`localtunnel setup failed, beacuse {err.stack || err.message}`
);
logger.notify(
`url is available at ${chalk.underline.blue(tunnel.url)}`
);
}
);
tunnel.on('error', err => {
logger.error(err.message);
});
});
// onCreate
return () => {
if(tunnel) tunnel.close();
}
if (tunnel) tunnel.close();
};
}
}
};
};
{
"name": "svrx-plugin-localtunnel",
"version": "0.0.1",
"version": "1.0.0",
"description": "localtunnel plugin for server-x",

@@ -8,3 +8,3 @@ "main": "index.js",

"engines": {
"svrx": "~0.0"
"svrx": "^1.0.0"
},

@@ -11,0 +11,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc