-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
190 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,10 @@ FROM alpine:3.19 | |
LABEL maintainer="[email protected]" | ||
WORKDIR /app | ||
COPY --from=build /tmp/seamoon /app/seamoon | ||
COPY ./entrypoint.sh /app/entrypoint.sh | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \ | ||
apk add tor && \ | ||
echo -e "RunAsDaemon 1\n\nAssumeReachable 1\n\nLog notice file /var/log/tor/tor.log" > /etc/tor/torrc &&\ | ||
chmod +x /app/entrypoint.sh && chmod +x /app/seamoon | ||
EXPOSE 1080 8080 7777 9000 | ||
ENTRYPOINT ["/app/seamoon"] | ||
ENTRYPOINT ["/app/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: Tor | ||
date: 2022-09-29 23:45:03 | ||
permalink: /guide/client/tor | ||
article: false | ||
--- | ||
|
||
## 🧅 Tor 网络开启 | ||
|
||
::: warning 注意 | ||
tor 服务比较吃内存,经测试 内存至少需要配置在 100MB 以上才能发挥稳定的效果。 | ||
::: | ||
|
||
为了防止普通流量过 Tor 导致的速率下降,在客户端做了个开关。 | ||
|
||
客户端会根据这个这个开关来选择是否给服务端发送 Tor 代理标识。 | ||
|
||
服务端接收到 Tor 代理标识后,会将流量直接转发给本地服务。 | ||
|
||
![tor](https://seamoon.oss-cn-hangzhou.aliyuncs.com/ec26347f298a4f9d81f7068eb3c0e4dc.png) | ||
|
||
注意,tor 网络目前仅支持: 本地 socks5 代理 + websocket 隧道 的模式。 | ||
|
||
然后本地的 socks5 代理即可访问一些 .onion 结尾的域名了。如: | ||
|
||
`https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/` | ||
|
||
|
||
![onion](https://seamoon.oss-cn-hangzhou.aliyuncs.com/09626bede56b4c18b6cd4d41d3e11c00.png) | ||
|
||
|
||
::: tips | ||
在当前版本内,seamoon 实现了最简单的 tor 接入方式 -- 通过 tor cli 自带的 s5 协议做了一层转发,因为 v2ray 也是这样玩的。 | ||
|
||
实际上,这种方案,有很多不足,出去开头的资源占用较高 warning,通过 binary 的集成力度也不是非常合适,但是在这个阶段暂时用该方案来减少代码开发的工作量。 | ||
|
||
因此,此方案仅用于证明 seamoon 的扩展性,距离真正 "便宜" 可能还需要一段的距离。 | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: TOR | ||
date: 2024-01-29 11:05:23 | ||
permalink: /tech/net/tor/ | ||
article: false | ||
--- | ||
# TOR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
if [ "$TOR" = "true" ]; then | ||
tor | ||
fi | ||
|
||
/app/seamoon "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.