Sign inSign up

shilazi/remote-bind

By shilazi

Updated almost 3 years ago

https://github.com/rust-net/remote-bind

Image
0

198

shilazi/remote-bind repository overview

A simple image for remote-bind

Dockerfile

FROM rust:1.74.0-slim-bookworm

ARG RBIND_TAG=3.0
ENV GIT_REPO=https://github.com/rust-net/remote-bind

RUN set -x \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        git git-lfs curl ca-certificates tzdata \
    && rm -rf /var/lib/apt/lists/*

RUN set -x \
    && git clone -b ${RBIND_TAG} ${GIT_REPO} repo \
    && cd repo \
    && cargo build --release \
    && find target/release -maxdepth 1 -type f ! -name '*.*' -exec mv {} /tmp/ \;

# ---------- 8< ----------

FROM debian:bookworm-slim

RUN set -x \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        ca-certificates tzdata \
    && rm -rf /var/lib/apt/lists/*

COPY --from=0 /tmp/* /usr/bin/

Usage

Relay Mode
Server
version: '3.9'

services:
  remote-bind:
    image: shilazi/remote-bind:v3.0
    container_name: remote-bind-server
    command: server 1234 passwd
    network_mode: host
    privileged: true
    restart: unless-stopped
Client

Work with STUN

version: '3.9'

services:
  remote-bind:
    image: shilazi/remote-bind:v3.0
    container_name: remote-bind-client
    command: client x.x.x.x:1234 13389 passwd 127.0.0.1:3389
    network_mode: host
    privileged: true
    restart: unless-stopped

Work with P2P

version: '3.9'

services:
  remote-bind:
    image: shilazi/remote-bind:v3.0
    container_name: remote-bind-client
    command: client p2p x.x.x.x:1234 13389 127.0.0.1:3389
    network_mode: host
    privileged: true
    restart: unless-stopped
Gateway Mode
version: '3.9'

services:
  remote-bind:
    image: shilazi/remote-bind:v3.0
    container_name: remote-bind-oneport
    command: oneport -c /data/config.yml
    network_mode: host
    privileged: true
    volumes:
    - ./data/:/data/
    restart: unless-stopped

Example config.yml

config:
  # 监听地址
  listen: 0.0.0.0:1111
  # 热重启接口
  api: 127.0.0.111:11111

rules:
    # 字符串匹配
  - rule: GET /oneport/status
    address: 127.0.0.111:11111
    # 首字节匹配
  - rule: 3
    address: 127.0.0.1:3389
    # 多字节匹配
  - rule: [0x53, 0x53]
    address: 127.0.0.1:22
    # 内置规则
  - rule: $SSH
    address: 127.0.0.1:22
    # 内置规则可能是多个规则的集合,比如 $HTTP 匹配 GET、POST 等多个字符串
  - rule: $HTTP
    address: 127.0.0.1:80
    # 通配规则
  - rule: []
    address: 127.0.0.1:4444

Tag summary

Content type

Image

Digest

sha256:f22065965

Size

39.3 MB

Last updated

almost 3 years ago

docker pull shilazi/remote-bind:v3.0