[macOS] macOS Monterey無法使用釘釘內網穿透工具


按照釘釘官方文檔: https://open.dingtalk.com/document/tutorial/dingtalk-logon-free-third-party-websites

把內網穿透工具拉到本地之后,運行,會報以下錯誤

fatal error: runtime: bsdthread_register error

runtime stack:
runtime.throw(0x14bd408, 0x21)
	/usr/local/go/src/runtime/panic.go:619 +0x81 fp=0x7ff7bfeff1c8 sp=0x7ff7bfeff1a8 pc=0x102a911
runtime.goenvs()
	/usr/local/go/src/runtime/os_darwin.go:129 +0x83 fp=0x7ff7bfeff1f8 sp=0x7ff7bfeff1c8 pc=0x1028493
runtime.schedinit()
	/usr/local/go/src/runtime/proc.go:496 +0xa4 fp=0x7ff7bfeff250 sp=0x7ff7bfeff1f8 pc=0x102d1d4
runtime.rt0_go(0x7ff7bfeff288, 0x4, 0x7ff7bfeff288, 0x0, 0x1000000, 0x4, 0x7ff7bfeff460, 0x7ff7bfeff467, 0x7ff7bfeff47a, 0x7ff7bfeff48e, ...)
	/usr/local/go/src/runtime/asm_amd64.s:252 +0x1f4 fp=0x7ff7bfeff258 sp=0x7ff7bfeff250 pc=0x10540d4

查了很久,是因為go某些版本對於macOS Monterey支持有問題。而釘釘內網穿透工具官方已經很久不更新了!

不過在網友強大的力量下,終於解決了這個問題

 

安裝docker

請自行Google! 

 

添加代碼

參考這位網友的pr,到pierced目錄新建對應的文件: https://github.com/open-dingtalk/pierced/pull/49/files

比如,pierced在擺放在 /System/Volumes/Data/Software/Project/test/pierced

當前目錄文件如下

▾ linux/                                                                                                                                                   
    ding*
    ding.cfg
▸ mac_64/
▸ windows_64/
  README.md

Dockerfile

touch Dockerfile
vim Dockerfile

內容如下

FROM ubuntu:latest
MAINTAINER dirname
WORKDIR /pierced
COPY linux .
RUN chmod a+x run.sh
ARG subdomain
ENV DOMAIN=${subdomain}
ARG addr
ENV ADDRESS=${addr}

CMD ["/pierced/run.sh"]

 

Makefile

touch Makefile
vim Makefile

內容如下

build:
	docker build -t pierced:1.0 --build-arg subdomain=$(subdomain) --build-arg addr=$(addr) .

run:
	docker run --name pierced -d pierced:1.0

 

linux/run.sh

touch linux/run.sh
vim linux/run.sh

內容如下

#!/bin/bash

echo "start server: $ADDRESS -> $DOMAIN"
/pierced/ding --config=/pierced/ding.cfg --subdomain=$DOMAIN $ADDRESS

 

構建鏡像

make build subdomain={subdomain} addr={宿主機IP:端口}

{subdomain}就是你的子域名

{宿主機IP:端口}是你本機的ip和項目運行端口,注意一定要加上ip

比如如下命令

make build subdomain=abcdef addr=192.168.10.11:9999

 

啟動

make run

 

這個時候,就可以通過http://abcdef.vaiwan.com/ 訪問到你本機啦!

 

Have fun with docker!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM