[GH-ISSUE #3] Bug: Issue with URL Generation in nport using API method #1

Closed
opened 2026-03-04 01:38:01 +03:00 by kerem · 1 comment
Owner

Originally created by @gitSambhal on GitHub (Jan 22, 2025).
Original GitHub issue: https://github.com/tuanngocptn/nport/issues/3

Hi @tuanngocptn Found a bug when using the package in API

The script hangs when using nport.link without server subdomain. Additionally, the generated URL format is incorrect.

const socketTunnel = require('nport/lib/api');

const main = () => {

  // The script just hangs on using the nport.link without the subdomain
  // const server = 'https://nport.link'; 

  const server = 'https://server.nport.link';
  const subDomain = 'my-subdomain';
  const port = 3000;

  socketTunnel
    .connect(server, subDomain, port)
    .then((url) => {
    // The output url is https://my-subdomain.server.nport.link and it doesn't work
    // but accessing the url https://my-subdomain.nport.link works.
    // so the output should be correct working url.
      console.log('🚀 ~ .then ~ url:', url);  // Incorrect URL format
    })
    .catch((err) => {
      console.error(err);
    });
};

main();

Expected Behavior:
The correct URL https://my-subdomain.nport.link should be returned.

Actual Behavior:
The returned URL is https://my-subdomain.server.nport.link, which doesn’t work. Accessing https://my-subdomain.nport.link works fine.

Environment:
• Version of nport: 1.0.6
• Node.js version: 20.15.0
• OS: Mac

Additional Context:
• The script hangs when nport.link is used without a subdomain in server.

Originally created by @gitSambhal on GitHub (Jan 22, 2025). Original GitHub issue: https://github.com/tuanngocptn/nport/issues/3 Hi @tuanngocptn Found a bug when using the package in API The script hangs when using nport.link without `server` subdomain. Additionally, the generated URL format is incorrect. ```js const socketTunnel = require('nport/lib/api'); const main = () => { // The script just hangs on using the nport.link without the subdomain // const server = 'https://nport.link'; const server = 'https://server.nport.link'; const subDomain = 'my-subdomain'; const port = 3000; socketTunnel .connect(server, subDomain, port) .then((url) => { // The output url is https://my-subdomain.server.nport.link and it doesn't work // but accessing the url https://my-subdomain.nport.link works. // so the output should be correct working url. console.log('🚀 ~ .then ~ url:', url); // Incorrect URL format }) .catch((err) => { console.error(err); }); }; main(); ``` **Expected Behavior:** The correct URL https://my-subdomain.nport.link should be returned. **Actual Behavior:** The returned URL is https://my-subdomain.server.nport.link, which doesn’t work. Accessing https://my-subdomain.nport.link works fine. **Environment:** • Version of nport: 1.0.6 • Node.js version: 20.15.0 • OS: Mac **Additional Context:** • The script hangs when nport.link is used without a subdomain in server.
kerem closed this issue 2026-03-04 01:38:01 +03:00
Author
Owner

@tuanngocptn commented on GitHub (Dec 8, 2025):

Thanks for your reporting. The problem from the server is going down at that time 😂. Everything is okay now. I have a plan for moving to using serverless that will running only when user request. Now that still runing 24/7 -> That not really good now

<!-- gh-comment-id:3627649243 --> @tuanngocptn commented on GitHub (Dec 8, 2025): Thanks for your reporting. The problem from the server is going down at that time :joy:. Everything is okay now. I have a plan for moving to using serverless that will running only when user request. Now that still runing 24/7 -> That not really good now
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nport#1
No description provided.