跳至主要内容

泥貓 (mudcat)

簡介​

這是為Mudfish Networks提供的HTTP/TCP/UDP連接埠共享服務。我們的目標是提供與https://ngrok.io類似目的的服務。

使用此服務,您可以輕鬆地將內部網路上的服務共用給外部。我們目前支援以下協議:

  • HTTP

  • TCP

  • UDP

使用指令1可以輕鬆安裝和使用它。

下載​

您可以從 https://www.mudcat.io/ 下載程式。

由於mudcat程式由可執行檔1組成,使用者可以輕鬆下載並執行它。

mudcat 執行選項​

當您執行mudcat程式時,您可以看到以下畫面。基本上,mudcat 的用法根據命令的不同而略有不同。

$ ./mudcat 
Usage: mudcat [-vV] <command> [<args>]

Options:
-v # Increase the verbose level.
-V, --version # Show the version.

Commands:
http # Create a HTTP tunnel.
node # Show the mudcat nodes.
tcp # Create a TCP tunnel.
udp # Create a UDP tunnel.

目前支援的命令如下。

  • http

    當您想要轉送 HTTP 連接埠時可以使用此功能。

  • node

    顯示用於轉送的 mudcat 中繼伺服器的資訊。

  • tcp

    當您想要轉送 TCP 連接埠時可以使用此功能。

  • UDP

    當您想要轉送 UDP 連接埠時可以使用此功能。

基本上,當您執行./mudcat <command> -h時,您可以額外查看該命令提供的協助資訊。

mudcat http 指令​

當您想要提供HTTP轉發服務時,可以使用該指令。當您只想將通常在內部建立的服務公開給外部時,可以使用此命令。

$ ./mudcat http -h
Usage: mudcat http [options]
--domain <domain> # Specify the domain name to access.
--local-addr <ip> # Specify the local IP to connect. Default
# value is 127.0.0.1
--local-port <port> # Specify the local port. Default value is 80.
--node-cc <cc> # Specify the country code to hint the
# selection of mudcat nodes.
--node-id <nid> # Specify the unique ID of mudcat node.

支援的子選項包括:

  • --domain <domain>

    如果指定此選項,則可以指定 domain 而不是任意網域位址(通常是數字位址)。例如,當指定 --domain abc 時,指派的網域位址變成 abc.mudcat.io。

  • --local-addr <ip>

    此選項指定要將 HTTP 轉送至的本機位址 (IPv4)。預設值為 127.0.0.1。

    但是,該值不一定指向內部網路位址。如果要指向另一個遠端Public IP,可以指定IP。

  • --local-port <port>

    HTTP 指定要轉送至的本機連接埠。預設為 80。

  • --node-cc <cc>

    您可以指定要使用的 mudcat 中繼伺服器的國家代碼。例如,如果您將國家代碼指定為 JP,則將自動指派日本的 mudcat 中繼伺服器。

  • --node-id <nid>

    您可以指定要使用的 mudcat 中繼伺服器的 unique ID。各中繼伺服器的unique ID可以透過mudcat node指令取得。

mudcat node 指令​

此指令用於檢索 mudcat 中繼伺服器資訊。

$ ./mudcat node -h
Usage: mudcat node [--json-raw]
--json-raw # Prints the raw JSON output.

使用 ./mudcat node 指令時,您可以看到目前正在執行的 mudcat 中繼伺服器的清單。支援的子選項包括:

  • --json-raw

    中繼伺服器清單以 JSON 格式輸出。

mudcat tcp 指令​

當您想要提供TCP轉發服務時,可以使用該指令。

$ ./mudcat tcp -h
Usage: mudcat tcp [options]
--conn-uuid <uuid> # Set the connection UUID to reuse.
--domain <domain> # Specify the domain name to access.
--local-addr <ip> # Specify the local IP to connect. Default
# value is 127.0.0.1
--local-port <port> # Specify the local port. If not specified,
# --remote-port value will be used.
--node-cc <cc> # Specify the country code to hint the
# selection of mudcat nodes.
--node-id <nid> # Specify the unique ID of mudcat node.
--remote-port <port> # Specify the remote port.

支援的子選項包括:

  • --conn-uuid <uuid>

    當您想要重複使用先前使用過的 remote port 時,可以使用此選項。

    通常情況下,如果使用分配的 remote port 後斷開連接,則對應的 remote port 將無法使用,直到其資源被釋放。

    但是,如果您知道先前的 Connection UUID,則可以立即重複使用該 remote port。

  • --domain <domain>

    如果指定此選項,則可以指定 domain 而不是任意網域位址(通常是數字位址)。例如,當指定 --domain abc 時,指派的網域位址變成 abc.mudcat.io。

  • --local-addr <ip>

    此選項指定要將 TCP 轉送至的本機位址 (IPv4)。預設值為 127.0.0.1。

    但是,該值不一定指向內部網路位址。如果要指向另一個遠端Public IP,可以指定IP。

  • --local-port <port>

    TCP 指定要轉送至的本機連接埠。如果未指定該選項,則使用 --remote-port <port> 的值作為連接埠資訊。

  • --node-cc <cc>

    您可以指定要使用的 mudcat 中繼伺服器的國家代碼。例如,如果您將國家代碼指定為 JP,則將自動指派日本的 mudcat 中繼伺服器。

  • --node-id <nid>

    您可以指定要使用的 mudcat 中繼伺服器的 unique ID。各中繼伺服器的unique ID可以透過mudcat node指令取得。

  • --remote-port <port>

    在mudcat中繼伺服器中,指定TCP port播放listening。

mudcat udp 指令​

當您想要提供UDP轉發服務時,可以使用該指令。

$ ./mudcat udp -h
Usage: mudcat udp [options]
--conn-uuid <uuid> # Set the connection UUID to reuse.
--domain <domain> # Specify the domain name to access.
--local-addr <ip> # Specify the local IP to connect. Default
# value is 127.0.0.1
--local-port <port> # Specify the local port. If not specified,
# --remote-port value will be used.
--node-cc <cc> # Specify the country code to hint the
# selection of mudcat nodes.
--node-id <nid> # Specify the unique ID of mudcat node.
--remote-port <port> # Specify the remote port.

支援的子選項包括:

  • --conn-uuid <uuid>

    當您想要重複使用先前使用過的 remote port 時,可以使用此選項。

    通常情況下,如果使用分配的 remote port 後斷開連接,則對應的 remote port 將無法使用,直到其資源被釋放。

    但是,如果您知道先前的 Connection UUID,則可以立即重複使用該 remote port。

  • --domain <domain>

    如果指定此選項,則可以指定 domain 而不是任意網域位址(通常是數字位址)。例如,當指定 --domain abc 時,指派的網域位址變成 abc.mudcat.io。

  • --local-addr <ip>

    此選項指定要將 UDP 轉送至的本機位址 (IPv4)。預設值為 127.0.0.1。

    但是,該值不一定指向內部網路位址。如果要指向另一個遠端Public IP,可以指定IP。

  • --local-port <port>

    UDP 指定要轉送至的本機連接埠。如果未指定該選項,則使用 --remote-port <port> 的值作為連接埠資訊。

  • --node-cc <cc>

    您可以指定要使用的 mudcat 中繼伺服器的國家代碼。例如,如果您將國家代碼指定為 JP,則將自動指派日本的 mudcat 中繼伺服器。

  • --node-id <nid>

    您可以指定要使用的 mudcat 中繼伺服器的 unique ID。各中繼伺服器的unique ID可以透過mudcat node指令取得。

  • --remote-port <port>

    在mudcat中繼伺服器中,指定UDP port播放listening。

發行說明​

0.0.3 (2023-01-21)​

  • 新增了以下新選項:

    • --domain
    • --node-id

0.0.2 (2023-01-20)​

  • 修復了在 Windows 上無法正常運作的問題。

0.0.1 (2023-01-18)​

  • 這是第一個版本。他們表示將實現一個基本的實現,但預計仍會有許多改進和錯誤。我們會一點一點地表現出進步。