Thanks to visit codestin.com
Credit goes to github.com

Skip to content

支援 bahamut BBS websocket #44

@ElvisChiang

Description

@ElvisChiang

via https://gist.github.com/ShikChen/b6664174d8ed067bb610dba0ca805335

安裝 websocat

修改 proxy.sh

懶得寫判斷了,大概意思是...

--- proxy.sh.bak        2022-12-15 14:40:45.000000000 +0800
+++ proxy.sh    2022-12-15 14:58:12.000000000 +0800
@@ -1,7 +1,11 @@
 #!/usr/bin/env bash
 echo "Connecting to BBS via Websockets..."
 BASEDIR=$(dirname "$0")
-echo "$BASEDIR/usock2wsock" -u $1 -r $2
-"$BASEDIR/usock2wsock" -u $1 -r $2 &
+killall websocat > /dev/null 2>&1
+/usr/local/bin/websocat --oneshot --binary \
+    --ping-interval=10 \
+    --origin=https://term.gamer.com.tw \
+    tcp-l:127.0.0.1:1337 \
+    wss://term.gamer.com.tw/bbs &
 sleep 2
-"$BASEDIR/telnet" -8 -u /tmp/telnetBYwebsocket.$2.sock
+"$BASEDIR/telnet" -8 localhost 1337

1337 是隨意指定的 port

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions