Skip to content

Commit

Permalink
v2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Azimjon Pulatov committed Jan 2, 2024
1 parent bae161b commit 9341a1e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"time"
)

var version = "2.2"
var version = "2.3"

type Flags struct {
debug bool
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 23 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

---

Expand All @@ -18,18 +18,20 @@

1. Install the latest <a href='https://github.com/azimjohn/jprq/releases'>release</a> of JPRQ<br>
2. Place the file where it is convenient for you<br><br>
<i>(At this point, you can use the program, but you will need to manually call the <code>.exe</code> file)</i><br>
<i>(At this point, you can use the program, but you will need to manually call the <code>.exe</code> file)</i><br>
3. Create <b>jprq.bat</b> file so we can use the "jprq" keyword to call the <b>.exe</b> file<br>

```bash
@echo off
"C:\Exact\Path\To\File\jprq-windows-386.exe" %*
```

4. Awesome! Finally, we need to <a href="https://www.youtube.com/watch?v=gb9e3m98avk">add to the environment variable "PATH"</a>, the path to the folder where we created .bat file <i>(step 3)</i><br><br>
4. Awesome! Finally, we need to <a href="https://www.youtube.com/watch?v=gb9e3m98avk">add to the environment variable "
PATH"</a>, the path to the folder where we created .bat file <i>(step 3)</i><br><br>

<p align='center'><b>Congratulations!</b> You can check if everything is working with the jprq command in CMD</p>
<hr>

</details>

<details>
Expand Down Expand Up @@ -61,7 +63,6 @@ Arch-based distros
yay -S jprq
```


</details>

## How to use
Expand All @@ -85,28 +86,39 @@ jprq tcp 22
```

For using custom subdomains

```bash
jprq http 3000 -s custom
jprq http 3000 -s <custom-name>
```

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

<a href="https://www.buymeacoffee.com/azimjon" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
8 changes: 4 additions & 4 deletions server/jprq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}()
}
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 9 additions & 3 deletions website/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ <h1>jprq - join public router, quickly.</h1>

<h3>What's JPRQ?</h3>
<ul>
<li>JPRQ is a free and open tool for exposing local servers to public network</li>
<li>It can expose TCP protocols, such as HTTP, SSH, all major databases</li>
<li>JPRQ is a free and open tool for exposing local servers to public network (the internet)</li>
<li>It can expose TCP protocols, such as HTTP, SSH, etc. Any server!</li>
</ul>

<h3>How to install/update</h3>
Expand All @@ -103,12 +103,18 @@ <h3>Start http tunnel with custom subdomain</h3>
<p>Replace "custom" with the subdomain you want</p>
<pre>$ <code class="language-sh">jprq http 3000 -s custom</code></pre>

<h3>Serve files with built-in HTTP Server</h3>
<h3>Serve static files with built-in HTTP Server</h3>
<p>Replace "." with any directory to serve</p>
<pre>$ <code class="language-sh">jprq serve .</code></pre>

<h3>Debug http tunnels with jprq debugger</h3>
<p>Debug dashboard URL will show up in output</p>
<pre>$ <code class="language-sh">jprq http 3000 --debug</code></pre>

<h3>Serve on a different domain using CNAME</h3>
<p>Replace example.com with your own domain
<br>Domain should have CNAME record pointing to your jprq.app to work</p>
<pre>$ <code class="language-sh">jprq http 3000 --cname example.com</code></pre>
</main>

<script>
Expand Down
2 changes: 1 addition & 1 deletion website/static/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9341a1e

Please sign in to comment.