nport 1.0.2 → 1.0.4

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # **NPort**
2
2
 
3
+ ## Overview
4
+
5
+ [![GitHub](https://img.shields.io/github/stars/tuanngocptn/nport?style=social)](https://github.com/tuanngocptn/nport)
6
+ [![NPM](https://img.shields.io/npm/v/nport?color=red&logo=npm)](https://www.npmjs.com/package/nport)
7
+ [![Website](https://img.shields.io/website?url=https%3A%2F%2Fnport.link&up_message=nport.link&up_color=blue&down_color=lightgrey&down_message=offline)](https://nport.link)
8
+
9
+
10
+ ![Logo][Logo]
11
+ ![nport](https://github.com/user-attachments/assets/3f61ae7a-bff7-45d8-8f40-8e04b301a63a)
3
12
  NPort is a **Node.js-based tool** that tunnels HTTP connections through **Socket.IO** streams, enabling you to expose local servers via public URLs easily and securely. It is particularly useful for **development environments**, testing webhooks, and sharing projects on local servers.
4
13
 
5
14
  ---
@@ -35,22 +44,24 @@ npm install -g git+https://github.com/tuanngocptn/nport.git # global install
35
44
  ## **How to use**
36
45
 
37
46
  ```sh
38
- npx nport --s xxx -p 3000 # https://xxx.nport.link (local install)
47
+ npx nport -s xxx -p 3000 # https://xxx.nport.link (local install)
39
48
 
40
- nport --s xxx -p 3000 # https://xxx.nport.link (global install)
49
+ nport -s xxx -p 3000 # https://xxx.nport.link (global install)
41
50
  ```
42
51
  **OR**
43
52
 
44
53
  ```sh
45
- npx nport --server https://nport.link --subdomain xxx --hostname 127.0.0.1 --port 3000 # https://xxx.nport.link (local install)
54
+ npx nport --server https://server.nport.link --subdomain xxx --hostname 127.0.0.1 --port 3000 # https://xxx.nport.link (local install)
46
55
 
47
- nport --server https://nport.link --subdomain xxx --hostname 127.0.0.1 --port 3000 # https://xxx.nport.link (global install)
56
+ nport --server https://server.nport.link --subdomain xxx --hostname 127.0.0.1 --port 3000 # https://xxx.nport.link (global install)
48
57
  ```
49
58
 
50
59
  # Source from socket-tunnel
51
60
 
52
- Tunnel HTTP connections via socket.io streams. Inspired by [localtunnel](https://github.com/localtunnel/localtunnel).
61
+ Tunnel HTTP connections via socket.io streams. Inspired by [Socket Tunnel](https://github.com/ericbarch/socket-tunnel).
53
62
 
54
63
  ## Blog Post
55
64
 
56
- [Read all about it](https://ericbarch.com/post/sockettunnel/)
65
+ [Read all about it](https://ericbarch.com/post/sockettunnel/)
66
+
67
+ [Logo]: https://img.shields.io/badge/🌶️_nport-FDC753?style=for-the-badge
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.2",
3
+ "version": "1.0.4",
4
4
  "description": "Tunnel HTTP Connections via socket.io streams.",
5
5
  "keywords": ["tunnel", "socket.io", "http", "streaming", "networking", "proxy"],
6
- "homepage": "https://github.com/tuanngocptn/nport#readme",
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.