Giter Club home page Giter Club logo

bore's Introduction

bore

Build status Crates.io

A modern, simple TCP tunnel in Rust that exposes local ports to a remote server, bypassing standard NAT connection firewalls. That's all it does: no more, and no less.

Video demo

# Installation (requires Rust, see alternatives below)
cargo install bore-cli

# On your local machine
bore local 8000 --to bore.pub

This will expose your local port at localhost:8000 to the public internet at bore.pub:<PORT>, where the port number is assigned randomly.

Similar to localtunnel and ngrok, except bore is intended to be a highly efficient, unopinionated tool for forwarding TCP traffic that is simple to install and easy to self-host, with no frills attached.

(bore totals about 400 lines of safe, async Rust code and is trivial to set up โ€” just run a single binary for the client and server.)

Installation

If you're on macOS, bore is packaged as a Homebrew core formula.

brew install bore-cli

Otherwise, the easiest way to install bore is from prebuilt binaries. These are available on the releases page for macOS, Windows, and Linux. Just unzip the appropriate file for your platform and move the bore executable into a folder on your PATH.

You also can build bore from source using Cargo, the Rust package manager. This command installs the bore binary at a user-accessible path.

cargo install bore-cli

We also publish versioned Docker images for each release. The image is built for an AMD 64-bit architecture. They're tagged with the specific version and allow you to run the statically-linked bore binary from a minimal "scratch" container.

docker run -it --init --rm --network host ekzhang/bore <ARGS>

Detailed Usage

This section describes detailed usage for the bore CLI command.

Local Forwarding

You can forward a port on your local machine by using the bore local command. This takes a positional argument, the local port to forward, as well as a mandatory --to option, which specifies the address of the remote server.

bore local 5000 --to bore.pub

You can optionally pass in a --port option to pick a specific port on the remote to expose, although the command will fail if this port is not available. Also, passing --local-host allows you to expose a different host on your local area network besides the loopback address localhost.

The full options are shown below.

Starts a local proxy to the remote server

Usage: bore local [OPTIONS] --to <TO> <LOCAL_PORT>

Arguments:
  <LOCAL_PORT>  The local port to expose

Options:
  -l, --local-host <HOST>  The local host to expose [default: localhost]
  -t, --to <TO>            Address of the remote server to expose local ports to [env: BORE_SERVER=]
  -p, --port <PORT>        Optional port on the remote server to select [default: 0]
  -s, --secret <SECRET>    Optional secret for authentication [env: BORE_SECRET]
  -h, --help               Print help information

Self-Hosting

As mentioned in the startup instructions, there is a public instance of the bore server running at bore.pub. However, if you want to self-host bore on your own network, you can do so with the following command:

bore server

That's all it takes! After the server starts running at a given address, you can then update the bore local command with option --to <ADDRESS> to forward a local port to this remote server.

The full options for the bore server command are shown below.

Runs the remote proxy server

Usage: bore server [OPTIONS]

Options:
      --min-port <MIN_PORT>  Minimum accepted TCP port number [default: 1024]
      --max-port <MAX_PORT>  Maximum accepted TCP port number [default: 65535]
  -s, --secret <SECRET>      Optional secret for authentication [env: BORE_SECRET]
  -h, --help                 Print help information

Protocol

There is an implicit control port at 7835, used for creating new connections on demand. At initialization, the client sends a "Hello" message to the server on the TCP control port, asking to proxy a selected remote port. The server then responds with an acknowledgement and begins listening for external TCP connections.

Whenever the server obtains a connection on the remote port, it generates a secure UUID for that connection and sends it back to the client. The client then opens a separate TCP stream to the server and sends an "Accept" message containing the UUID on that stream. The server then proxies the two connections between each other.

For correctness reasons and to avoid memory leaks, incoming connections are only stored by the server for up to 10 seconds before being discarded if the client does not accept them.

Authentication

On a custom deployment of bore server, you can optionally require a secret to prevent the server from being used by others. The protocol requires clients to verify possession of the secret on each TCP connection by answering random challenges in the form of HMAC codes. (This secret is only used for the initial handshake, and no further traffic is encrypted by default.)

# on the server
bore server --secret my_secret_string

# on the client
bore local <LOCAL_PORT> --to <TO> --secret my_secret_string

If a secret is not present in the arguments, bore will also attempt to read from the BORE_SECRET environment variable.

Acknowledgements

Created by Eric Zhang (@ekzhang1). Licensed under the MIT license.

The author would like to thank the contributors and maintainers of the Tokio project for making it possible to write ergonomic and efficient network services in Rust.

bore's People

Contributors

antoniomika avatar az-pz avatar bastidood avatar bxoxsxs avatar calfzhou avatar cedric05 avatar ekzhang avatar jihchi avatar jtroo avatar kianmeng avatar orhun avatar praveenperera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bore's Issues

Bore line count in README is no longer accurate

This refers to:

(bore totals less than 400 lines of safe, async Rust code and is trivial to set up โ€” just run a single binary for the client and server.)

Maybe the new benchmark should be sub-1000? Or could remove the text entirely.

> tokei
===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 BASH                    4           48           30           10            8
 Dockerfile              1           10            9            0            1
 TOML                    1           37           34            0            3
-------------------------------------------------------------------------------
 Markdown                1           86            0           48           38
 |- Shell                1           41           30            4            7
 (Total)                            127           30           52           45
-------------------------------------------------------------------------------
 Rust                    8          638          531            7          100
 |- Markdown             7           84            1           76            7
 (Total)                            722          532           83          107
===============================================================================
 Total                  15          819          604           65          150
===============================================================================

Specify default server to forward to via environment variable

Since most users will have setup their own bore server, this server will likely not change a lot.
However users are still required to always specify the server they want to forward to.

I would suggest reading from an environment variable (BORE_SERVER for example) when the --to option is omitted.

Ceveats/pricing?

Hi,

It appears you have created a free, open source, tunnelling service, with no bandwidth limits. Is this the case? Or are there caveats to this service (I wouldn't blame you for putting a bandwidth limit)? What about the privacy aspects? Is everything end-to-end encrypted?

If there are caveats, is there a form of paid plan to remove those? I would self-host, but I'm looking into this tool specifically because my ISP wants to make me pay for port forwarding, something I find a bit ridiculous.

I don't want to use your tool and pass a lot of bandwidth through if that's not what it's for, or not what it can support, but if that is possible, I will probably look into it. I want my file server to be accessible from the outside, and I don't think what my ISP is doing is right.

In any case, thank you for developing this tool!

mention HTTP support

What about builtin http support? This would make this tool useful for web devs as well.

[Idea] Show url with "http://"

Idea:

When bore starts listening, (say, at bore.pub:9999), show the url with http:// before (i.e http://bore.pub:9999).
This allows for terminals with clickable link support to allow users to click on the link, instead of having to copy it.

I know that this will not work for every case, as the port bore is talking to does not necessarily use HTTP, and that bore needs a way to recognize a port as using HTTP, without compromising traffic or sending too many requests, which might invalidate or falsify any analytics data or logs.

Note that this concept could be applied to multiple protocols, even though it might be overkill.

powerpc support?

bore is awesome!

My router and NAS chips are powerpc32 chips. So it will be great to be supported.

I am a noob to rust. Don't know if it's easy to port to powerpc. Thanks in advance if you guys make it!

Device or resource busy (os error 16)

It's a powerpc32 NAS. i cross compiled a static link bore for it.

When run bore local 9090 --to bore.pub. The program exited with:

Error: could not connect to bore.pub:7835

Caused by:
    Device or resource busy (os error 16)

Have tried my own server. Failed the same.

maybe a memory issues?

root@OpenWrt:/data# time -f "Maximum resident set size (kbytes): %Mkb" ./bore-
s local 9090 --to bore.pub
Error: could not connect to bore.pub:7835

Caused by:
    Device or resource busy (os error 16)
Command exited with non-zero status 1
Maximum resident set size (kbytes): 10832kb

while free tell me:

root@OpenWrt:~# free -h
              total        used        free      shared  buff/cache   available
Mem:         251876      105792       22672       15704      123412       82060
Swap:             0           0           0

Also, i ran with strace:

brk(NULL)                               = 0x10adb000
brk(0x10adbe94)                         = 0x10adbe94
uname({sysname="Linux", nodename="OpenWrt", ...}) = 0
set_tid_address(0x10adb068)             = 14094
set_robust_list(0x10adb070, 12)         = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x101b6d60, sa_mask=[], sa_flags=SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x101b6e50, sa_mask=[], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
readlink("/proc/self/exe", "/data/bore-s", 4096) = 12
brk(0x10afce94)                         = 0x10afce94
brk(0x10afd000)                         = 0x10afd000
mprotect(0x10336000, 106496, PROT_READ) = 0
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 0 (Timeout)
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGSEGV, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGSEGV, {sa_handler=0x1018cd30, sa_mask=[], sa_flags=SA_ONSTACK|SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGBUS, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGBUS, {sa_handler=0x1018cd30, sa_mask=[], sa_flags=SA_ONSTACK|SA_SIGINFO}, NULL, 8) = 0
sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0
mmap2(NULL, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb7c01000
mprotect(0xb7c01000, 4096, PROT_NONE)   = 0
sigaltstack({ss_sp=0xb7c02000, ss_flags=0, ss_size=16384}, NULL) = 0
openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "00100000-00103000 r-xp 00000000 "..., 1024) = 478
close(3)                                = 0
sched_getaffinity(14094, 32, [0])       = 4
getrandom("\xdf\xc5\x06\x68\xd3\xdf\x1a\xa4\xac\x73\x7e\x68\xf7\x02\xb8\xac", 16, GRND_NONBLOCK) = 16
openat(AT_FDCWD, "/proc/self/cgroup", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "0::/services/dropbear/instance1\n", 8192) = 32
read(3, "", 8192)                       = 0
close(3)                                = 0
sched_getaffinity(0, 128, [0])          = 4
epoll_create1(EPOLL_CLOEXEC)            = 3
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 4
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN|EPOLLRDHUP|EPOLLET, {u32=0, u64=2147483648}}) = 0
fcntl64(3, F_DUPFD_CLOEXEC, 3)          = 5
clock_gettime64(CLOCK_MONOTONIC, {tv_sec=694316, tv_nsec=987092879}) = 0
futex(0x10353c08, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mmap2(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb7a00000
mprotect(0xb7a01000, 2097152, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0xb7bffcd0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[14095], tls=0xb7c07640, child_tidptr=0xb7c001d8) = 14095
clock_gettime64(CLOCK_MONOTONIC, {tv_sec=694316, tv_nsec=990417119}) = 0
mmap2(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb77ff000
mprotect(0xb7800000, 2097152, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0xb79fecd0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[14096], tls=0xb7a06640, child_tidptr=0xb79ff1d8) = 14096
write(4, "\0\0\0\0\0\0\0\1", 8)         = 8
futex(0x10adf144, FUTEX_WAIT_BITSET_PRIVATE, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0
write(4, "\0\0\0\0\0\0\0\1", 8)         = 8
futex(0x10adf238, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x10adf1c8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x10adf144, FUTEX_WAIT_BITSET_PRIVATE, 1, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0xb79ff1d8, FUTEX_WAIT, 14096, NULL) = 0
write(2, "Error: ", 7Error: )                  = 7
write(2, "could not connect to bore.pub:78"..., 34could not connect to bore.pub:7835) = 34
write(2, "\n\nCaused by:", 12

Caused by:)          = 12
write(2, "\n", 1
)                       = 1
write(2, "    ", 4    )                     = 4
write(2, "Device or resource busy", 23Device or resource busy) = 23
write(2, " (os error ", 11 (os error )             = 11
write(2, "16", 216)                       = 2
write(2, ")", 1))                        = 1
write(2, "\n", 1
)                       = 1
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=16384}, NULL) = 0
munmap(0xb7c01000, 20480)               = 0
exit_group(1)                           = ?
+++ exited with 1 +++

Firewall/NGINX configuration on the server

Thanks so much for this wonderful tool, and for the excellent example of a simple and useful Rust codebase.

I'm not totally familiar with how tunnels work, and so it may be that this is an easy question to answer: but how does one set this up when using a firewall (UFW) and NGINX on the server-side? Do I need to expose just the control port in the NGINX configuration, or will there be issues when attempting to open a new tunnel?

Thanks again for the excellent software!

bore and bore-cli

Hi, Iโ€™m the author of bore, another Rust CLI in the networking space. Iโ€™ve been working on my next release for the last couple months, but Iโ€™m worried our projects having the same name might lead to some confusion.

Do you have any thoughts around how we can work together? Thanks!

SSL certificate

I probably have a stupid question again. Is it possible to add support for ssl certificates as in localtunnel? Or is it already there and I'm really stupid that I didn't find it?

Heroku

Does Bore server work on Heroku?

tracing colors cannot be suppressed

I am running bore to expose local ports to a remote Windows server and it works quite well, thank you!

The only annoyance I have noticed that log/tracing colors do not seem to be able to be turned off, which make the log files look funny when for example wrapping bore in WinSW (for running as a Windows service).

image

I tried NO_COLOR, that only affects the help colors; but that does not affect tracing: tokio-rs/tracing#2388.

Opening this issue to make you aware of that so it could be fixed when there is a fix in tokio tracing. :)

Minimum port is ignored if port on local is 0

Hello,
I was trying to add option for max port however I discovered issue and wanted to discuss it before any action.

When you set minimum port on server and the client send wanted port using -p option the server correctly check if it's in range or not.

But when the port is set to 0 (or not given) by local the check is skipped because of condition:

if port != 0 && port < self.min_port {

Port is selected by TcpListener from tokio which is bypassing the setting.

The simplest solution that came to my mind is to generate random port on server within given range so currently MIN_PORT and 65535

What do you think?

Port range

Is there a way to connect a range of ports to a bore server?

Bandwidth limits?

Will the bandwidth of the client be limited and does the bandwidth of the server matter?

build failed

OS: uname -a
Linux instance-20210901-1753 5.8.0-1037-oracle #38~20.04.1-Ubuntu SMP Fri Jul 16 01:02:14 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
cargo 1.57.0

$ cargo install bore-cli
Updating crates.io index
Installing bore-cli v0.3.0
Compiling version_check v0.9.4
Compiling proc-macro2 v1.0.37
Compiling unicode-xid v0.2.2
Compiling libc v0.2.123
Compiling autocfg v1.1.0
Compiling cfg-if v1.0.0
Compiling syn v1.0.91
Compiling typenum v1.15.0
Compiling lazy_static v1.4.0
Compiling log v0.4.16
Compiling memchr v2.4.1
Compiling serde_derive v1.0.136
Compiling smallvec v1.8.0
Compiling parking_lot_core v0.9.2
Compiling cc v1.0.73
Compiling serde v1.0.136
Compiling subtle v2.4.1
Compiling scopeguard v1.1.0
Compiling adler v1.0.2
Compiling gimli v0.26.1
Compiling heck v0.4.0
Compiling hashbrown v0.11.2
Compiling serde_json v1.0.79
Compiling once_cell v1.10.0
Compiling pin-project-lite v0.2.8
Compiling rustc-demangle v0.1.21
Compiling anyhow v1.0.56
Compiling os_str_bytes v6.0.0
Compiling ansi_term v0.12.1
Compiling termcolor v1.1.3
Compiling bitflags v1.3.2
Compiling cpufeatures v0.2.2
Compiling ryu v1.0.9
Compiling bytes v1.1.0
Compiling itoa v1.0.1
Compiling textwrap v0.15.0
Compiling strsim v0.10.0
Compiling hex v0.4.3
Compiling generic-array v0.14.5
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling lock_api v0.4.7
Compiling miniz_oxide v0.4.4
Compiling indexmap v1.8.1
Compiling tracing-core v0.1.26
Compiling sharded-slab v0.1.4
Compiling backtrace v0.3.64
Compiling thread_local v1.1.4
Compiling addr2line v0.17.0
Compiling clap_lex v0.1.1
Compiling quote v1.0.18
Compiling tracing-log v0.1.2
Compiling num_cpus v1.13.1
Compiling getrandom v0.2.6
Compiling mio v0.8.2
Compiling atty v0.2.14
Compiling socket2 v0.4.4
Compiling object v0.27.1
Compiling tracing-subscriber v0.3.11
Compiling parking_lot v0.12.0
Compiling crypto-common v0.1.3
Compiling block-buffer v0.10.2
Compiling tokio-macros v1.7.0
Compiling tracing-attributes v0.1.20
Compiling dashmap v5.2.0
Compiling digest v0.10.3
Compiling clap_derive v3.1.7
Compiling tokio v1.17.0
Compiling sha2 v0.10.2
Compiling hmac v0.12.1
Compiling tracing v0.1.34
Compiling clap v3.1.9
Compiling uuid v0.8.2
Compiling bore-cli v0.3.0
error: there is no argument named message
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.3.0/src/client.rs:56:73
|
56 | Some(ServerMessage::Error(message)) => bail!("server error: {message}"),
| ^^^^^^^^^

error: there is no argument named to
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.3.0/src/client.rs:64:29
|
64 | info!("listening at {to}:{remote_port}");
| ^^^^

error: there is no argument named remote_port
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.3.0/src/client.rs:64:34
|
64 | info!("listening at {to}:{remote_port}");
| ^^^^^^^^^^^^^

error: there is no argument named to
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.3.0/src/client.rs:130:52
|
130 | .with_context(|| format!("could not connect to {to}:{port}"))
| ^^^^

error: there is no argument named port
--> /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.3.0/src/client.rs:130:57
|
130 | .with_context(|| format!("could not connect to {to}:{port}"))
| ^^^^^^

error: could not compile bore-cli due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile bore-cli v0.3.0, intermediate artifacts can be found at /tmp/cargo-installaFExns

Caused by:
build failed

installation via brew

Hello, I really love the project; Thanks for crafting it ๐Ÿ™‚

Is any chance to make it possible to install via brew?

This will be helpful to reduce the installation friction, especially for non Rust developers.

Public instance is being used for lots of traffic

Recently (in the past month) I've gotten bills for 1.5 TB of data transfer from the public instance of bore, at bore.pub.

If I had deployed this on AWS, there would be problems because it would be costing me between $100-$200. However I anticipated that there would be some traffic, so I deployed it on DigitalOcean specifically to take advantage of their low pricing on network egress at $0.01/GB, which is 10x cheaper than other cloud offerings.

However, 1.5 TB is way more than I was expecting for usage of this service. So this is a gentle reminder that if you're using the public instance of bore, try to use it for its intended purpose, which is as a short-lived way to expose ports to the Internet. Please respect other users and be reasonable with how much data you transfer.

By the way, if you'd like to help me keep bore running, any amount of contribution through GitHub Sponsors would be very much appreciated. Even $1/month lets me support 100 GB of network transfer through the public instance. :)

I really don't want to shut the public service down, and I won't unless the costs are significantly higher than they are now, but here's a warning regardless before we get too close the point of what I'm willing to spend on a free, hobby service.

Install does not work

Hey, I ran into this issue while installing the cli.

Running cargo install bore-cli gives the following error :

error: there is no argument named `message`
  --> /Users/theaupoulat/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.3/src/client.rs:47:73
   |
47 |             Some(ServerMessage::Error(message)) => bail!("server error: {message}"),
   |                                                                         ^^^^^^^^^

error: there is no argument named `to`
  --> /Users/theaupoulat/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.3/src/client.rs:55:29
   |
55 |         info!("listening at {to}:{remote_port}");
   |                             ^^^^

error: there is no argument named `remote_port`
  --> /Users/theaupoulat/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.3/src/client.rs:55:34
   |
55 |         info!("listening at {to}:{remote_port}");
   |                                  ^^^^^^^^^^^^^

error: there is no argument named `to`
   --> /Users/theaupoulat/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.3/src/client.rs:120:52
    |
120 |     .with_context(|| format!("could not connect to {to}:{port}"))
    |                                                    ^^^^

error: there is no argument named `port`
   --> /Users/theaupoulat/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.3/src/client.rs:120:57
    |
120 |     .with_context(|| format!("could not connect to {to}:{port}"))
    |                                                         ^^^^^^

error: could not compile `bore-cli` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
         Building [=======================> ] 109/111: tokio                                                       error: failed to compile `bore-cli v0.2.3`, intermediate artifacts can be found at `/var/folders/bs/_r3q6dsd6wq0d9fbw1t8pk_r0000gn/T/cargo-installwSAvMU`

Caused by:
  build failed

Running it on macOS Monterey v12.1

bore to lan

Would be very useful if it would be possible to provide not only local tunnel, but also a tunnel to LAN, to expose something behind a router/FW. ngrok supports this as well.

local to reconnect to server

Hey, I'm wondering if there's a way (at least on the roadmap) for local to reconnect to the server if something comes into the way? My local stuff is inside the home network and the server runs on a VPS out in the wild. When I'm not home while the server restarts, I loose connection until I get back and also restart the local.

UDP forwarding support

Will this support UDP? It looks great, but I want to be able to forward some of my UDP-based services.

Bad Request Did not attempt to load JSON data because the request Content-Type was not 'application/json'.

Bad Request

Did not attempt to load JSON data because the request Content-Type was not 'application/json'.
getting this error for bore local 5000 --to bore.pub
app.py

  • Serving Flask app 'app' (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: on
  • Running on all addresses (0.0.0.0)
    WARNING: This is a development server. Do not use it in a production deployment.
  • Running on http://127.0.0.1:5000
  • Running on http://192.168.1.151:5000 (Press CTRL+C to quit)
  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 130-822-908

Connection keeps closing

I'm testing a neural network on google colab. I put the output through bore and it closes the connection every minute for some reason. It also sometimes just closes the tunnel without informing the user

INFO proxy{id=0f4b7534-baa4-480e-b6c3-4993e9744751}: bore_cli::client: connection exited
image

Feature request: read server secret from environment variable

It would be absolutely fantastic to be able to store a custom secret (if configured) as an environment variable so as to avoid typing it out or copying and pasting it every time bore is run -- well, specifically for the use case of self-hosting a bore instance.

I'd open a PR, but my Rust might make many people claw their eyes out.

Reverse Proxy Support

I would like to see the ability to forward local ports to a custom random path instead of a random port to allow support of domains that run other services behind a reverse proxy.

For example, when forwarding a local port (say 5000) to bore.pub, instead of the resulting URL being bore.pub:12345, it could be proxy.bore.pub/12345/. This could be a challenge given that applications at the local port would likely request content at a different path, but reverse proxies, like Traefik, already support path modifications. Alternatively, subdomains could be generated(i.e. abc.proxy.bore.pub), but that requires a more complicated SSL configuration.

Connection to bore.pub timed out

I am running bore on a windows machine, after installing it via cargo. My express server is running on port 9000
I am trying to create a tunnel to port 9000

Error Image

This is the error I am facing. Kindly check.

Min port is not respected for randomly assigned ports

The min port number is applied when the client tries to request a specific port, but not when the port is randomly assigned (when client sends port 0).

To reproduce the error:

$ bore server --min-port 65530
2023-02-12T17:49:49.232469Z  INFO bore_cli::server: server listening addr=0.0.0.0:7835
2023-02-12T17:50:08.387048Z  INFO control{addr=127.0.0.1:55590}: bore_cli::server: incoming connection
2023-02-12T17:50:08.387064Z  INFO control{addr=127.0.0.1:55590}: bore_cli::server: new client port=0

# On a different terminal
$ bore local 8000 --to localhost
2023-02-12T17:50:08.387095Z  INFO bore_cli::client: connected to server remote_port=37941
2023-02-12T17:50:08.387102Z  INFO bore_cli::client: listening at localhost:37941

The randomly assigned port is below the configured minimum.

Looking at the codebase, TcpListener doesn't seem to have any interface for specifying a minimum port for randomly assigned ports. A solution would likely have to randomly pick ports within the server and not leave it to the OS by setting it to 0.

UDP?

Trying to run UDP over bore appeares to not work. Could you add UDP support?

Feature request: Use DNS instead of random ports

Hi, Thank you for this wonderful project.

It would be great to have all connection go threw a single port and redirected via subdomains (like frp/ngrok).

For example:

xxx.bore.pub
yyy.bore.pub

Thanks,

Compiling error: there is no argument named ...

Compiling with cargo install bore-cli prints out a few there is no argument named errors. This is running on a fresh ubuntu (version 20.04) within a container, with only Rust installed.

root@96d3d25c45a9:/# cargo install bore-cli
    Updating crates.io index
  Installing bore-cli v0.2.1
   Compiling libc v0.2.122
   Compiling proc-macro2 v1.0.37
   Compiling version_check v0.9.4
   Compiling unicode-xid v0.2.2
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling syn v1.0.91
   Compiling typenum v1.15.0
   Compiling memchr v2.4.1
   Compiling log v0.4.16
   Compiling lazy_static v1.4.0
   Compiling smallvec v1.8.0
   Compiling parking_lot_core v0.9.2
   Compiling serde_derive v1.0.136
   Compiling scopeguard v1.1.0
   Compiling cc v1.0.73
   Compiling serde v1.0.136
   Compiling subtle v2.4.1
   Compiling adler v1.0.2
   Compiling once_cell v1.10.0
   Compiling gimli v0.26.1
   Compiling serde_json v1.0.79
   Compiling hashbrown v0.11.2
   Compiling heck v0.4.0
   Compiling anyhow v1.0.56
   Compiling pin-project-lite v0.2.8
   Compiling rustc-demangle v0.1.21
   Compiling termcolor v1.1.3
   Compiling textwrap v0.15.0
   Compiling ansi_term v0.12.1
   Compiling bytes v1.1.0
   Compiling ryu v1.0.9
   Compiling strsim v0.10.0
   Compiling bitflags v1.3.2
   Compiling itoa v1.0.1
   Compiling cpufeatures v0.2.2
   Compiling hex v0.4.3
   Compiling tracing-core v0.1.24
   Compiling sharded-slab v0.1.4
   Compiling thread_local v1.1.4
   Compiling generic-array v0.14.5
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling lock_api v0.4.7
   Compiling miniz_oxide v0.4.4
   Compiling indexmap v1.8.1
   Compiling backtrace v0.3.64
   Compiling tracing-log v0.1.2
   Compiling tracing-subscriber v0.3.11
   Compiling object v0.27.1
   Compiling os_str_bytes v6.0.0
   Compiling quote v1.0.17
   Compiling num_cpus v1.13.1
   Compiling getrandom v0.2.6
   Compiling socket2 v0.4.4
   Compiling mio v0.8.2
   Compiling atty v0.2.14
   Compiling signal-hook-registry v1.4.0
   Compiling parking_lot v0.12.0
   Compiling addr2line v0.17.0
   Compiling dashmap v5.2.0
   Compiling block-buffer v0.10.2
   Compiling crypto-common v0.1.3
   Compiling digest v0.10.3
   Compiling sha2 v0.10.2
   Compiling hmac v0.12.1
   Compiling tracing-attributes v0.1.20
   Compiling clap_derive v3.1.7
   Compiling tokio-macros v1.7.0
   Compiling tokio v1.17.0
   Compiling tracing v0.1.33
   Compiling clap v3.1.8
   Compiling uuid v0.8.2
   Compiling bore-cli v0.2.1
error: there is no argument named `message`
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.1/src/client.rs:47:73
   |
47 |             Some(ServerMessage::Error(message)) => bail!("server error: {message}"),
   |                                                                         ^^^^^^^^^

error: there is no argument named `to`
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.1/src/client.rs:55:29
   |
55 |         info!("listening at {to}:{remote_port}");
   |                             ^^^^

error: there is no argument named `remote_port`
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.1/src/client.rs:55:34
   |
55 |         info!("listening at {to}:{remote_port}");
   |                                  ^^^^^^^^^^^^^

error: there is no argument named `to`
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.1/src/client.rs:120:52
    |
120 |     .with_context(|| format!("could not connect to {to}:{port}"))
    |                                                    ^^^^

error: there is no argument named `port`
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/bore-cli-0.2.1/src/client.rs:120:57
    |
120 |     .with_context(|| format!("could not connect to {to}:{port}"))
    |                                                         ^^^^^^

error: could not compile `bore-cli` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `bore-cli v0.2.1`, intermediate artifacts can be found at `/tmp/cargo-installwbzfEn`

Caused by:
  build failed

bore on Kubernetes

I'm wondering if creating a PR about how to run bore on a Kubernetes cluster would be interesting for the project?

I run all my stuff on k8s in my home network so I had to figure out the way of running bore too. I can create a README with the deployment instructions, including the Kubernetes manifest files.

Quick Question

If i had a service that needed more than one port tunnled... would I just open multiple bore instances for each port?

More info please

I like the project, but I'm trying to understand life use case scenario. Despite all the description is not clear to me. Does it support SSL, can you provide real use case scenario?
Can I tunnel specific port?
For example I have employer machine with zscaler proxy (like VPN) that puts me in the company network so I can access let say SQL database. Can I tunnel the specific port from employer machine to my personal machine so I could make a SQL connection from my personal?

cargo install bore-cli failed

log:

pi@raspberrypi:~/Bore$ cargo install bore-cli
    Updating `https://mirrors.ustc.edu.cn/crates.io-index` index
error: failed to download `bore-cli v0.4.0`

Caused by:
  unable to get packages from source

Caused by:
  failed to download replaced source registry `https://github.com/rust-lang/crates.io-index`                                        

Caused by:
  failed to parse manifest at `/home/pi/.cargo/registry/src/mirrors.ustc.edu.cn-12df342d903acd47/bore-cli-0.4.0/Cargo.toml`         

Caused by:
  failed to parse the `edition` key

Caused by:
  supported edition values are `2015` or `2018`, but `2021` is unknown

cargo config

pi@raspberrypi:~/Bore$ cat ~/.cargo/config
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.