initial
This commit is contained in:
commit
74ae93a96e
1 changed files with 94691 additions and 0 deletions
52
joplin notion extension/Web Development/nodejs/ngrok.md
Normal file
52
joplin notion extension/Web Development/nodejs/ngrok.md
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
ngrok
|
||||
https://reyhann.medium.com/how-to-expose-your-localhost-server-using-ngrok-9928ac2e26b8
|
||||
https://www.npmjs.com/package/ngrok
|
||||
|
||||
- adding token through command
|
||||
`ngrok config add-authtoken <TOKEN>`
|
||||
|
||||
```js
|
||||
const PORT = process.env.PORT || 8080;
|
||||
(async function () {
|
||||
try {
|
||||
await ngrok.authtoken(token);
|
||||
const url = await ngrok.connect(PORT);
|
||||
console.log("url: ", url);
|
||||
} catch (err) {
|
||||
console.log("err: ", err);
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
- for multiple accounts in same machine
|
||||
https://jd-bots.com/2022/03/04/how-to-use-multiple-ngrok-accounts-on-one-computer-in-windows/
|
||||
`ngrok http 80 -config="C:\Users\jagdish\.ngrok2\my-ngrok-2.yml"`
|
||||
format of `ngrok.yml`
|
||||
```yml
|
||||
version: "2"
|
||||
authtoken: <AUTH_TOKEN>
|
||||
```
|
||||
|
||||
- in shell
|
||||
ngrok http 80 (here 80 is port number)
|
||||
- in termux
|
||||
to fix "failed get HOME directory"
|
||||
first you need to type "whoami" without quote in your termux.
|
||||
that will showed the user
|
||||
~ $ whoami
|
||||
u0_a185l
|
||||
|
||||
copy the output (u0_a185l) for me.
|
||||
than add the user to path by typing "export USER=u0_a185l"
|
||||
~ $ export USER=u0_a185
|
||||
enter.
|
||||
and re-run ngrok
|
||||
~ $ ./ngrok
|
||||
or
|
||||
https://github.com/Yisus7u7/termux-ngrok/
|
||||
- using wifi instead of mobile data in termux
|
||||
https://www.youtube.com/watch?v=EGaZ9SajayY
|
||||
simply use proot-distro and use ngrok from there, ngrok if installed in termux will work just have to configure auth-token separately
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in a new issue