40

Mr2.js free can help you expose local server to external network

 4 years ago
source link: https://www.tuicool.com/articles/ba2YFjr
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Mr2.js

Mr2.js is javascript client with built-in free server of mr2 can help you expose local server to external network.

Install

$ npm install -g @txthinking/mr2

Usage

$ mr2 -c 127.0.0.1:1234

Advanced usage

Built-in server

# expose your local server 127.0.0.1:1234
$ mr2 -c 127.0.0.1:1234
# expose your local directory /path/to/www
$ mr2 -d /path/to/www
# Specify a subdomain
$ mr2 -D xxx -c 127.0.0.1:1234
# View built-in server list
$ mr2 -l
# Specify a built-in server
$ mr2 -s us.mr2.dev:2222 -c 127.0.0.1:1234
# Specify a built-in server and subdomain
$ mr2 -s us.mr2.dev:2222 -D xxx -c 127.0.0.1:1234

Customize mr2 server

# Local server is 127.0.0.1:1234, expect to expose: server_address:5678
$ mr2 -s server_address:port -p password -P 5678 -c 127.0.0.1:1234
# Local web root is /path/to/www, expect to expose: server_address:5678
$ mr2 -s server_address:port -p password -P 5678 -d /path/to/www

License

Licensed under The GPLv3 License


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK