<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.hshh.org/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Hshh&#039;s Cosmos xnix</title>
        <description></description>
        <link>https://www.hshh.org/</link>
        <lastBuildDate>Thu, 09 Apr 2026 23:54:47 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://www.hshh.org/lib/tpl/dokuwiki/images/favicon.ico</url>
            <title>Hshh&#039;s Cosmos</title>
            <link>https://www.hshh.org/</link>
        </image>
        <item>
            <title>3proxy 精简配置</title>
            <link>https://www.hshh.org/xnix/3proxy?rev=1717011249&amp;do=diff</link>
            <description>3proxy 精简配置

3proxy.cfg


nserver 8.8.8.8
nserver 8.8.4.4
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
users user:CL:pass
daemon
log @3proxy
logformat &quot;- +_L%N.%p %E %U %C:%c %R:%r %O %I %h %T&quot;
setgid 65534
setuid 65534

auth iponly
flush
socks -i127.0.0.1 -p60000
proxy -i127.0.0.1 -p60001 -a

auth strong
flush
socks -i127.0.0.1 -p60010
proxy -i127.0.0.1 -p60011 -a</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>3proxy</category>
            <pubDate>Thu, 30 May 2024 03:34:09 +0000</pubDate>
        </item>
        <item>
            <title>试用dehydrated来获取 Let&#039;s Encrypt 的证书 (HTTP-01篇)</title>
            <link>https://www.hshh.org/xnix/dehydrated_http-01?rev=1717011473&amp;do=diff</link>
            <description>试用dehydrated来获取 Let&#039;s Encrypt 的证书 (HTTP-01篇)

dehydrated 是个非常轻量级的 Let&#039;s Encrypt 客户端. 可以使用 Bash 也可以使用 Zsh.

优点

	*  支持 HTTP-01 和 DNS-01 验证
	*  支持自动签名多个域名(domain.txt)
	*</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>dehydrated</category>
        <category>let_s_encrypt</category>
            <pubDate>Thu, 30 May 2024 03:37:53 +0000</pubDate>
        </item>
        <item>
            <title>自用 dnsmasq 的补丁集</title>
            <link>https://www.hshh.org/xnix/dnsmasq_patchset?rev=1714820248&amp;do=diff</link>
            <description>自用 dnsmasq 的补丁集

patch-dnsmasq-try-all-servers-upon-failure

当 dnsmasq 启用 all-servers 时, 将会把请求同时发送到所有上游服务器, 并且采纳最快响应的结果返回给客户端. 但是如果最快响应的结果是 SERVFAIL, dnsmasq 也依然直接返回给客户端.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>freebsd</category>
        <category>dnsmasq</category>
            <pubDate>Sat, 04 May 2024 18:57:28 +0000</pubDate>
        </item>
        <item>
            <title>MAC 下通过 ssh 更新 rustdesk</title>
            <link>https://www.hshh.org/xnix/mac_update_rustdesk_via_ssh?rev=1758098942&amp;do=diff</link>
            <description>MAC 下通过 ssh 更新 rustdesk

在只有远程控制的 mac 下, 如果需要更新 rustdesk, 在图形界面下, 需要先把 rustdesk 退出, 才可以从 dmg 中覆盖旧版本.

这就会有先有鸡还是先有蛋的问题了. 而且覆盖更新后, 启动 rustdesk, 还需要点击启动服务, 非常不友好.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>xnix</category>
            <pubDate>Wed, 17 Sep 2025 16:49:02 +0000</pubDate>
        </item>
        <item>
            <title>使用 nghttpx 搭建一个 HTTPS PROXY</title>
            <link>https://www.hshh.org/xnix/nghttpx_http2_tls_proxy?rev=1744997828&amp;do=diff</link>
            <description>使用 nghttpx 搭建一个 HTTPS PROXY

背景介绍: nghttpx+3proxy做https proxy, 其中3proxy的http proxy监听地址为127.0.0.1:12344

本案例, 将nghttpx监听在所有地址的12345端口.

在 FreeBSD 中, nghttpx 位于 ports 的 www/nghttp2. 如果需要ocsp, 务必同时安装python</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>nghttp2</category>
        <category>nghttpx</category>
        <category>https_proxy</category>
            <pubDate>Sat, 19 Apr 2025 01:37:08 +0000</pubDate>
        </item>
        <item>
            <title>Nginx + njs 记录 DoH 的查询域名</title>
            <link>https://www.hshh.org/xnix/nginx_doh_logging?rev=1717011646&amp;do=diff</link>
            <description>Nginx + njs 记录 DoH 的查询域名

nginx 不能直接记录 request body, 写了个简单的 js 配合 njs 模块, 并且解码 dns 封包获得查询的域名.

nginx.conf


http {
	# ... 省略设置
	# 定义日志格式
	log_format doh_log	&#039;$remote_addr - $remote_user [$time_local] &#039;
				&#039;&quot;$request&quot; $status $body_bytes_sent &#039;
				&#039;&quot;$http_referer&quot; &quot;$http_user_agent&quot; &quot;$dns_name&quot;&#039;;
	server {
		# ... 省略设置
		# 导入 dohlog.js, 该文件内容在下文
		js_import	/path/dohlog.js;
		# 预定义变量保存域名信息
		js_var		$dns_name;
		# 用 njs 替换原来的 /dns-query 用于记录
		location /dns-query {
			js_content	dohlog.log;
		}…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>nginx</category>
        <category>njs</category>
        <category>doh</category>
        <category>log</category>
        <category>post_content</category>
            <pubDate>Thu, 30 May 2024 03:40:46 +0000</pubDate>
        </item>
        <item>
            <title>使用 Nginx 代理 DoH</title>
            <link>https://www.hshh.org/xnix/nginx_doh_proxy?rev=1723712344&amp;do=diff</link>
            <description>使用 Nginx 代理 DoH

本文简述用 Nginx 代理 DoH (DNS Over HTTPS)的实现方式.

先说说碰到的坑.

	*  根据 RFC, DoH 应该是承载在 HTTP2 上, 而 nginx 的 proxy_pass 是不支持 h2 的, 需要用 gRPC 模块 grpc_pass 来代理转发. 部分支持 http1 的可以继续使用 proxy_pass.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>nginx</category>
        <category>doh</category>
        <category>proxy</category>
            <pubDate>Thu, 15 Aug 2024 16:59:04 +0000</pubDate>
        </item>
        <item>
            <title>使用 Nginx + njs 搭建 DNS over HTTPS (DoH)</title>
            <link>https://www.hshh.org/xnix/nginx_doh?rev=1717011672&amp;do=diff</link>
            <description>使用 Nginx + njs 搭建 DNS over HTTPS (DoH)

参考文档及源代码

	*  Using NGINX as a DoT or DoH Gateway
	*  NGINX DNS (DNS/DoT/DoH), nginx_stream.js源代码
	*  Introduction to the NGINX JavaScript Module
	*  njs scripting language
	*  njs source repository

为 Nginx 增加 njs 功能模块

对于 FreeBSD, ports安装时, 选上 NJS 模块即可, 如果选了 DSO, 则配置文件需要加载 njs 的 stream 模块.
另外 stream 模块都需要加上</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>nginx</category>
        <category>doh</category>
        <category>dns_over_https</category>
            <pubDate>Thu, 30 May 2024 03:41:12 +0000</pubDate>
        </item>
        <item>
            <title>使用 Nginx 搭建 DNS over TLS (DoT)</title>
            <link>https://www.hshh.org/xnix/nginx_dot?rev=1717011698&amp;do=diff</link>
            <description>使用 Nginx 搭建 DNS over TLS (DoT)

参考文档及源代码

	*  Using NGINX as a DoT or DoH Gateway

配置 Nginx

以下是简明配置, 详细的参考上面的文档 #1

如果上游DNS服务器使用DNS over TLS(DoT),一般是853端口, 则 stream 配置需要启用 proxy_ssl</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>nginx</category>
        <category>dot</category>
        <category>dns_over_tls</category>
            <pubDate>Thu, 30 May 2024 03:41:38 +0000</pubDate>
        </item>
        <item>
            <title>Nginx Stream SSL Tunnel 精简配置</title>
            <link>https://www.hshh.org/xnix/nginx_stream_ssl_tunnel?rev=1717011749&amp;do=diff</link>
            <description>Nginx Stream SSL Tunnel 精简配置

仅 Stream* 模块作TLS Tunnel的精简配置, 范例对应版本1.9.12

需要编译有stream和stream_ssl模块

证书生成部分不作介绍


# nginx.conf
...
load_module modules/ngx_stream_module.so;
...
http {
...
}
stream {
	ssl_protocols			TLSv1.2 TLSv1.3;
	ssl_ciphers			&quot;TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECD…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>nginx</category>
        <category>tls</category>
        <category>stream</category>
            <pubDate>Thu, 30 May 2024 03:42:29 +0000</pubDate>
        </item>
        <item>
            <title>搭建一个简单的 nginx webdav (FreeBSD)</title>
            <link>https://www.hshh.org/xnix/nginx_webdav?rev=1717011763&amp;do=diff</link>
            <description>搭建一个简单的 nginx webdav (FreeBSD)

功能简介

	*  基于FreeBSD ports的nginx
	*  多存储空间
	*  用户验证

配置

FreeBSD Ports 编译

需要选上 HTTP_DAV, 第三方的 HEADERS_MORE 和 HTTP_DAV_EXT 模块

目录结构 及 变量</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>nginx</category>
        <category>webdav</category>
            <pubDate>Thu, 30 May 2024 03:42:43 +0000</pubDate>
        </item>
        <item>
            <title>ocserv - OpenConnect Server</title>
            <link>https://www.hshh.org/xnix/ocserv?rev=1717011779&amp;do=diff</link>
            <description>ocserv - OpenConnect Server

安装

ports 或者 pkg : /usr/ports/net/ocserv

手动编译, 需要依赖 /usr/ports/archivers/liblz4 和 /usr/ports/security/gnutls

证书生成

CA

CA模板


$ cat &gt; ca.tmpl
cn = &quot;OpenConnect CA&quot;
organization = &quot;OpenConnect&quot;
serial = 1
expiration_days = 3650
ca
signing_key
cert_signing_key
crl_signing_key</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>ocserv</category>
            <pubDate>Thu, 30 May 2024 03:42:59 +0000</pubDate>
        </item>
        <item>
            <title>stunnel 的 TLS Tunnel 精简配置</title>
            <link>https://www.hshh.org/xnix/stunnel_tls_tunnel?rev=1717011797&amp;do=diff</link>
            <description>stunnel 的 TLS Tunnel 精简配置

只介绍 stunnel 作为 TLS Tunnel 的配置文件, 关于证书方面不介绍了.

不作客户端的证书验证, 仅TLS Tunnel

注: 对应新版openssl及stunnel, 以下配置为启用了TLSv1.3. 如果需要查看旧版TLSv1.2, 参看页面修改记录.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
        <category>stunnel</category>
            <pubDate>Thu, 30 May 2024 03:43:17 +0000</pubDate>
        </item>
    </channel>
</rss>
