Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-localtunnel-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-localtunnel-client

Expose a local server to the world using Localtunnel

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

grunt-localtunnel-client NPM version Dependency Status

Expose a local server to the world using Localtunnel

Getting Started

This plugin requires Grunt.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-localtunnel-client --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-localtunnel-client');

The "localtunnel_client" task

Overview

In your project's Gruntfile, add a section named localtunnel_client to the data object passed into grunt.initConfig().

grunt.initConfig({
    localtunnel_client: {
        server: {
            options: {
                port: 8000,
                subdomain: 'mytestdomain'
            }
        }
    }
})

Options

port

Type: Integer
Default: 8000

The port to tunnel. Local server should already be listening to this port before attempting to tunnel.

subdomain

Type: String Default: undefined

Request a subdomain to tunnel to on https://localtunnel.me.

local_host

Type: String Default: localhost

The local hostname for the requests tunnel.

keepalive

Type: Boolean
Default: false

Keep the server alive indefinitely. Note that if this option is enabled, any tasks specified after this task will never run. By default, once grunt's tasks have completed, the web server stops. This option changes that behavior.

This option can also be enabled ad-hoc by running the task like grunt localtunnel:targetname:keepalive

onSuccess

Type: Function Default: function(tunnel){}

Custom handler for tunnel success. Receives the tunnel instance as its only argument.

onError

Type: Function Default: function(err){}

Custom handler for tunnel error. Receives the tunnel error as its only argument.

Example

grunt.initConfig({
    localtunnel_client: {
        server: {
            options: {
                port: 8001,
                subdomain: 'myothertestdomain',
                local_host: 'myotherhost',
                keepalive: true,
                onSuccess: function(tunnel) {
                    grunt.log.ok('Connected at: ', tunnel.url);
                },
                onError: function(err) {
                    grunt.log.error('Not cool! ', err);
                }
            }
        }
    }
})

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 0.1.0 [18/04/2017]
    • Initial release

License

MIT © Renato Rodrigues

Keywords

FAQs

Package last updated on 25 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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