
포트 포워딩이나 계정 없이 브라우저 또는 CLI를 사용하여, 종단 간 암호화된 피어투피어 WebRTC를 통해 대화형 셸, 파일 전송, 웹 프록시를 제공하는 머신에 대한 안전한 원격 접속을 설정합니다.
bitbang은 단일 정적 바이너리로 제공되는 원격 접근 멀티툴입니다. 어떤 브라우저에서든 원격 머신에 대한 대화형 셸과 파일 브라우저에 접근할 수 있습니다. 또한 해당 머신의 네트워크에 있는 웹 앱에도 접근할 수 있습니다. 브라우저 외에도 TCP 포트 포워딩, 파일 복사, 터미널 공유를 지원합니다. 계정이나 설정이 필요 없으며, 그냥 실행하면 됩니다.

접근하려는 머신에서:``` curl -sSfL bitba.ng/install | sh bitbang serve
`serve`는 URL을 출력합니다. 아무 브라우저에서나 열면 터미널, 파일 브라우저, 그리고 해당 머신의 네트워크에 대한 프록시를 얻을 수 있습니다. 또는 다른 터미널에서 `bitbang connect <url>`로 같은 머신에 접속할 수 있으며, 이는 포트 포워딩(`-L`)과 파일 복사(`bitbang cp`)를 추가합니다. 연결은 종단 간 암호화되고 P2P 방식입니다. `bitba.ng` 서버는 양쪽 끝을 소개한 후 물러납니다.
`bitbang`은 단일 정적 Go 바이너리입니다. [BitBang 프로젝트](https://github.com/richlegrand/bitbang)의 일부이며, 이 [백서](https://github.com/richlegrand/bitbang/blob/main/whitepaper.md)에서 설계를 자세히 다룹니다.
## 비교
| | ngrok | Tailscale | `bitbang` |
| ------------------------------ | ---------------------- | ------------------------------ | ------------------- |
| 첫 사용 전 설정 | 계정 + authtoken | 계정 + 각 기기에서 로그인 | **명령 하나 실행** |
| 무언가를 공유하려면 실행하는 것 | 웹 서버 + ngrok | 양쪽 머신에 클라이언트 | **`bitbang serve`** |
| 원격 브라우저가 받는 것 | 이미 실행 중이던 웹 서버 | 없음 -- 클라이언트가 필요함 | **원격 네트워크의 터미널, 파일 브라우저, 웹 앱** |
| 데이터 경로 | 그들의 서버 | P2P (릴레이 폴백) | **P2P (릴레이 폴백)** |
| 종단 간 암호화 | 기본적으로 아님 | 예 | **예** |
## 빠른 레시피
**집에 있는 서비스에 접속하기**
- [어디서나 집 NAS 마운트하기 (SMB)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#mount-your-home-nas-from-anywhere-smb)
- [어디서나 미디어 라이브러리 시청하기 (Jellyfin)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#watch-your-media-library-from-anywhere-jellyfin)
- [어디서나 자체 LLM 사용하기 (Ollama, Open WebUI)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#use-your-own-llm-from-anywhere-ollama-open-webui)
- [보안 카메라 확인하기 (Frigate)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#check-your-security-cameras-frigate)
- [노출 없이 홈 자동화에 접속하기 (Home Assistant)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#reach-your-home-automation-without-exposing-it-home-assistant)
- [집 프린터로 인쇄하기 (IPP, CUPS)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#print-to-your-home-printer-ipp-cups)
**머신에 접속하기**
- [NAT 뒤의 머신에서 셸 얻기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#get-a-shell-on-a-machine-behind-nat)
- [휴대폰에서 셸 얻기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#get-a-shell-from-your-phone)
- [Windows 머신에 원격 데스크톱 접속 (RDP)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#remote-desktop-into-a-windows-machine-rdp)
- [Linux 또는 Mac 데스크톱 접속 (VNC)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#reach-a-linux-or-mac-desktop-vnc)
- [열린 포트가 없는 머신에 SSH 접속 (OpenSSH)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#ssh-to-a-machine-with-no-open-port-openssh)
- [헤드리스 Raspberry Pi 설정하기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#set-up-a-headless-raspberry-pi)
**다른 사람과 공유하기**
공유는 단순히 고유한 URL이나 QR 코드를 상대방에게 주는 것으로, 이를 통해 접근 권한을 부여합니다. 권한은 맞춤 설정할 수 있으며 몇 분, 몇 시간 등으로 만료되도록 설정할 수 있습니다.
- [파일을 어디에도 업로드하지 않고 공유하기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#share-files-without-uploading-them-anywhere)
- [프로젝트를 누군가에게 보여주기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#show-someone-your-project)
- [만료되는 접근 권한 부여하기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#give-someone-access-that-expires)
- [휴대폰에서 에이전트 세션 확인하기 (Claude Code, tmux)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#check-your-agent-session-from-your-phone-claude-code-tmux)
- [다른 사람의 라우터 고치기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#fix-someone-elses-router)
**개발 및 기기**
- [개발 머신에서 데이터베이스 접속 (Postgres, MySQL)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#reach-a-database-from-your-dev-machine-postgres-mysql)
- [서로를 찾지 못하는 기기 동기화 (Syncthing)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#sync-devices-that-cannot-find-each-other-syncthing)
- [브라우저에서 로봇 보기 (ROS, Foxglove)](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#watch-a-robot-from-a-browser-ros-foxglove)
**기법**
- [포워딩 리스너가 노출하는 것](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#what-a-forwarding-listener-exposes)
- [LAN의 다른 머신이 포워드를 사용하게 하기](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#let-other-machines-on-your-lan-use-a-forward)
- [작동하지 않는 것으로 알려진 것](https://github.com/richlegrand/bitbang/blob/main/cookbook.md#known-not-to-work)
## `bitbang` 사용하기
모든 연결에는 두 개의 끝이 있습니다: **리스너**(접속 대상 머신에서 실행되는 `bitbang serve`)와 **커넥터**(접속하는 머신의 브라우저 또는 `bitbang` CLI)입니다. 하나의 리스너 URL이 두 종류의 커넥터를 모두 지원합니다.
### 리스너: `bitbang serve````
bitbang serve # everything: shell + proxy + files + forward
bitbang serve shell # just a terminal
bitbang serve files ~/share # just a directory (-files-upload to allow uploads)
bitbang serve proxy localhost:8080 # just one web app, straight at the URL
bitbang serve proxy a.lan:80,b.lan:80 # ...or several, chosen in the browser
bitbang serve forward 127.0.0.1:22 # just TCP, for `connect -L`
bitbang serve shell files ~/share proxy nas.lan:8096 # any combination
각각은 QR 코드, URL 및 페어링 코드를 출력합니다. 모드는 리스너가 수행할 수 있는 작업을 결정합니다. serve shell은 전달할 포워딩이 없으며, 포워딩 전용 리스너는 셸을 시작하지 않으므로 권한을 상승시킬 대상이 없습니다.
알아두면 유용한 기본값 하나: 포워딩과 프록시는 리스너가 도달할 수 있는 모든 호스트:포트에 연결할 수 있습니다. 의도한 대상뿐만 아니라, 데이터베이스용으로 배포된 링크는 해당 네트워크의 나머지 부분에도 도달할 수 있습니다. 대상 이름을 단어 뒤에 지정하면 범위가 좁아집니다. forward db.internal:5432는 해당 대상에만 연결되고 다른 곳에는 연결되지 않습니다.
bitbang shareserve shell은 새 셸을 시작합니다. share는 이미 실행 중인 tmux 세션을 게시합니다.```
bitbang share # publish the current tmux session
bitbang share --read-only # publish without a control URL
bitbang share status|stop|rotate
The command returns after publishing, so `Ctrl-Z`, `bitbang share`, `fg`
works for a task already in progress. Hosting requires tmux 3.2+ on Unix or
WSL. Native Windows clients can open the URLs but cannot host a share.
By default, the command prints two bearer URLs:
- The **Control URL** can type with the same authority as the local keyboard.
One controller may connect at a time.
- The **View URL** is watch-only. Input is dropped before it reaches tmux, and
up to `--max-viewers` viewers may connect at once (default 16).
`--read-only` omits the control credential entirely. Viewer and controller
limits are held for each connection's lifetime, even before it opens a shell.
Shares run until stopped by default; `--ttl` sets a lifetime (e.g. `--ttl 1h`).
Share URLs are ephemeral and are never saved to `devices.json`. `share stop`,
TTL expiry, or removal of the source session disconnects remote peers without
stopping the source session.
Re-running `bitbang share` reprints the running share's URLs. If you
pass a flag that disagrees with what is running (say `--read-only`
against a share that has a control URL), it says so rather than
handing back the old URLs; `bitbang share rotate` replaces the share
with one that uses the new flags.
A background worker runs in a detached `_bbshare_*` tmux management session,
so there is no daemon or PID file to manage.