nport 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -43
- package/bin/client +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
package/README.md
CHANGED
|
@@ -1,62 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# <img src="https://nport.link/assets/imgs/nport-logo.png" height="30" style="vertical-align: middle;"> NPort
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> A Node.js tool for exposing local servers through Socket.IO tunnels
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
](https://github.com/tuanngocptn/nport)
|
|
6
|
+
[](https://www.npmjs.com/package/nport)
|
|
7
|
+
[](https://nport.link)
|
|
10
8
|
|
|
11
|
-
##
|
|
9
|
+
## What is NPort?
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
- **Secure and Lightweight**: A minimal, fast, and secure way to share your server without requiring complicated infrastructure.
|
|
15
|
-
- **Custom Subdomains**: Access your local server using easy-to-read public URLs.
|
|
16
|
-
- **WebSocket Support**: Handles WebSocket connections seamlessly.
|
|
17
|
-
- **Cross-Platform**: Works on Linux, macOS, and Windows systems.
|
|
11
|
+

|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
NPort allows you to expose your local HTTP servers to the internet using Socket.IO streams. Perfect for:
|
|
14
|
+
- Development environments
|
|
15
|
+
- Testing webhooks
|
|
16
|
+
- Sharing local projects
|
|
20
17
|
|
|
21
|
-
##
|
|
18
|
+
## ✨ Features
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
- 🔒 **Secure Tunneling**: Share your local server safely using Socket.IO
|
|
21
|
+
- 🚀 **Easy Setup**: Minimal configuration required
|
|
22
|
+
- 🌐 **Custom Domains**: Get readable URLs like `https://yourname.nport.link`
|
|
23
|
+
- 📡 **WebSocket Ready**: Full WebSocket connection support
|
|
24
|
+
- 💻 **Cross-Platform**: Runs on Windows, macOS, and Linux
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
## 📦 Installation
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**NPM Package**
|
|
29
|
+
```bash
|
|
30
|
+
# Local installation
|
|
31
|
+
npm install nport
|
|
29
32
|
|
|
30
|
-
#
|
|
33
|
+
# Global installation
|
|
34
|
+
npm install -g nport
|
|
35
|
+
```
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
**From GitHub**
|
|
38
|
+
```bash
|
|
39
|
+
# Local installation
|
|
40
|
+
npm install git+https://github.com/tuanngocptn/nport.git
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
# Global installation
|
|
43
|
+
npm install -g git+https://github.com/tuanngocptn/nport.git
|
|
35
44
|
```
|
|
36
45
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## **How to use**
|
|
46
|
+
## 🚀 Quick Start
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
### Basic Usage
|
|
49
|
+
```bash
|
|
50
|
+
# Local installation
|
|
51
|
+
npx nport -s myapp -p 3000
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
# Global installation
|
|
54
|
+
nport -s myapp -p 3000
|
|
45
55
|
```
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
nport --server https://
|
|
56
|
+
This will create a tunnel at `https://myapp.nport.link`
|
|
57
|
+
|
|
58
|
+
### Advanced Options
|
|
59
|
+
```bash
|
|
60
|
+
# Full configuration
|
|
61
|
+
npx nport --server https://server.nport.link \
|
|
62
|
+
--subdomain myapp \
|
|
63
|
+
--hostname 127.0.0.1 \
|
|
64
|
+
--port 3000
|
|
52
65
|
```
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Tunnel HTTP connections via socket.io streams. Inspired by [Socket Tunnel](https://github.com/ericbarch/socket-tunnel).
|
|
57
|
-
|
|
58
|
-
## Blog Post
|
|
59
|
-
|
|
60
|
-
[Read all about it](https://ericbarch.com/post/sockettunnel/)
|
|
61
|
-
|
|
62
|
-
[Logo]: https://img.shields.io/badge/🌶️_nport-FDC753?style=for-the-badge
|
|
67
|
+
## 📝 Credits
|
|
68
|
+
Inspired by [Socket Tunnel](https://github.com/ericbarch/socket-tunnel). Read more about the concept in this [blog post](https://ericbarch.com/post/sockettunnel/).
|
package/bin/client
CHANGED
|
@@ -5,7 +5,7 @@ let argv = optimist
|
|
|
5
5
|
.usage('Usage: $0 --server [string] --subdomain [string] --hostname [string] --port [number]')
|
|
6
6
|
.options('se', {
|
|
7
7
|
alias: 'server',
|
|
8
|
-
default: 'https://nport.link',
|
|
8
|
+
default: 'https://server.nport.link',
|
|
9
9
|
describe: 'Tunnel server endpoint'
|
|
10
10
|
})
|
|
11
11
|
.options('s', {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nport",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Tunnel HTTP Connections via socket.io streams.",
|
|
5
5
|
"keywords": ["tunnel", "socket.io", "http", "streaming", "networking", "proxy"],
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://nport.link",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/tuanngocptn/nport/issues",
|
|
9
9
|
"email": "tuanngocptn@gmail.com"
|
package/server.js
CHANGED
|
@@ -84,7 +84,7 @@ module.exports = (options) => {
|
|
|
84
84
|
// make sure we received a subdomain
|
|
85
85
|
let subdomain = tldjs.getSubdomain(hostname).toLowerCase();
|
|
86
86
|
if (!subdomain) {
|
|
87
|
-
return reject(new Error('Invalid subdomain'));
|
|
87
|
+
return reject(new Error('Invalid subdomain: Please visit https://github.com/tuanngocptn/nport for more information'));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
// tldjs library return subdomain as all subdomain path from the main domain.
|