From 9341a1ec80d5257bfa9bef48908391dc6776dc2a Mon Sep 17 00:00:00 2001 From: Azimjon Pulatov Date: Tue, 2 Jan 2024 20:52:48 +0100 Subject: [PATCH] v2.3 --- cli/main.go | 2 +- install.sh | 2 +- readme.md | 34 +++++++++++++++++++++++----------- server/jprq.go | 8 ++++---- website/static/index.html | 12 +++++++++--- website/static/install.sh | 2 +- 6 files changed, 39 insertions(+), 21 deletions(-) diff --git a/cli/main.go b/cli/main.go index 76acd2b..9f443bb 100644 --- a/cli/main.go +++ b/cli/main.go @@ -12,7 +12,7 @@ import ( "time" ) -var version = "2.2" +var version = "2.3" type Flags struct { debug bool diff --git a/install.sh b/install.sh index 25af125..6383b64 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -e -URL_PREFIX="https://github.com/azimjohn/jprq/releases/download/2.2" +URL_PREFIX="https://github.com/azimjohn/jprq/releases/download/2.3" INSTALL_DIR="/usr/local/bin" case "$(uname -sm)" in diff --git a/readme.md b/readme.md index b0f15b6..44eb4c3 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ ## What's JPRQ? - JPRQ is a free and open tool for exposing local servers to public network (the internet) -- it can expose TCP protocols, such as HTTP, SSH, major databases (MySQL, Postgres, Redis) +- It can expose TCP protocols, such as HTTP, SSH, etc. Any server! --- @@ -18,18 +18,20 @@ 1. Install the latest release of JPRQ
2. Place the file where it is convenient for you

-(At this point, you can use the program, but you will need to manually call the .exe file)
+ (At this point, you can use the program, but you will need to manually call the .exe file)
3. Create jprq.bat file so we can use the "jprq" keyword to call the .exe file
- + ```bash @echo off "C:\Exact\Path\To\File\jprq-windows-386.exe" %* ``` -4. Awesome! Finally, we need to add to the environment variable "PATH", the path to the folder where we created .bat file (step 3)

+4. Awesome! Finally, we need to add to the environment variable " + PATH", the path to the folder where we created .bat file (step 3)

+

Congratulations! You can check if everything is working with the jprq command in CMD


- +
@@ -61,7 +63,6 @@ Arch-based distros yay -S jprq ``` -
## How to use @@ -85,28 +86,39 @@ jprq tcp 22 ``` For using custom subdomains + ```bash -jprq http 3000 -s custom +jprq http 3000 -s ``` For using jprq debugger (with v2.1 or higher) + ```bash jprq http 3000 --debug ``` -Serve files using built-in HTTP Server +Serve static files using built-in HTTP Server (with v2.2 or higher) + ```bash jprq serve . ``` +Serve on a different domain using CNAME (with v2.3 or higher) + +```bash +jprq http 3000 --cname example.com +``` + Press Ctrl+C to stop it ### Update as of Oct 21, 2023 + ** jprq is now members-only service ** What does that mean? - - it still stays open and free to self-host - - to use the service I maintain, buy me a coffee and leave your github username - - I will send you invite link to keep using jprq + +- it still stays open and free to self-host +- to use the service I maintain, buy me a coffee and leave your github username +- I will send you invite link to keep using jprq Buy Me A Coffee diff --git a/server/jprq.go b/server/jprq.go index dc8836e..7bd3c2a 100644 --- a/server/jprq.go +++ b/server/jprq.go @@ -61,10 +61,10 @@ func (j *Jprq) Start() { go j.publicServer.Start(j.servePublicConn) go j.publicServerTLS.Start(j.servePublicConn) - go func() { // periodically load blocked users - j.loadBlockedUsers() + go func() { // periodically load allowed users + j.loadAllowedUsers() for range time.Tick(time.Minute) { - j.loadBlockedUsers() + j.loadAllowedUsers() } }() } @@ -200,7 +200,7 @@ func (j *Jprq) serveEventConn(conn net.Conn) error { return nil } -func (j *Jprq) loadBlockedUsers() { +func (j *Jprq) loadAllowedUsers() { stat, err := os.Stat(j.config.AllowedUsersFile) if err != nil { log.Printf("failed to stat blocked users file: %s", err) diff --git a/website/static/index.html b/website/static/index.html index f0237d1..f870ec9 100644 --- a/website/static/index.html +++ b/website/static/index.html @@ -80,8 +80,8 @@

jprq - join public router, quickly.

What's JPRQ?

How to install/update

@@ -103,12 +103,18 @@

Start http tunnel with custom subdomain

Replace "custom" with the subdomain you want

$ jprq http 3000 -s custom
-

Serve files with built-in HTTP Server

+

Serve static files with built-in HTTP Server

Replace "." with any directory to serve

$ jprq serve .

Debug http tunnels with jprq debugger

+

Debug dashboard URL will show up in output

$ jprq http 3000 --debug
+ +

Serve on a different domain using CNAME

+

Replace example.com with your own domain +
Domain should have CNAME record pointing to your jprq.app to work

+
$ jprq http 3000 --cname example.com