PixelStreamingInfrastructure https

目录

[SFU 大概率"不需要"改 HTTPS](#SFU 大概率“不需要”改 HTTPS)

批量替换脚本:


可以播放:

bash 复制代码
MetahumancharacterHeiXi.exe -RenderOffscreen -PixelStreamingIP=127.0.0.1 -PixelStreamingPort=8888 -AllowUntrustedCertificates

PixelStreamingInfrastructure https

|-------------------------|---------|------|
| SignallingWebServer | 前端网页服务器 | ✅ 必改 |

|----------------|------------------|------|
| Signalling | WebRTC 信令服务器(WS) | ✅ 必改 |

|---------|-------------|-------|
| SFU | WebRTC 媒体转发 | ⚠ 可能要 |

|--------------|------------|------|
| Frontend | 前端 JS 连接地址 | ✅ 必改 |

修改前:

python 复制代码
const config = require('./config');
const WebSocket = require('ws');
const mediasoup = require('mediasoup');
const mediasoupSdp = require('@epicgames-ps/mediasoup-sdp-bridge');
const minimist = require('minimist');

SFU 大概率"不需要"改 HTTPS

你真正要改的是 SignallingWebServer + Signalling

浏览器 (HTTPS)
↓
SignallingWebServer(网页 + JS)
↓
Signalling(WSS 信令)
↓
SFU(WebRTC 媒体传输,走 DTLS + SRTP)

批量替换脚本:

python 复制代码
import os

# 项目根目录(改成你的)
ROOT_DIR = r"D:\YourProject"

# 要忽略的目录
IGNORE_DIRS = {
    ".git",
    "node_modules",
    ".idea",
    "Docs",
    "Extras"
}

# 只处理这些类型的文件
TARGET_EXT = {
    ".js", ".ts", ".json", ".html", ".mjs", ".cjs"
}

def should_skip(path):
    parts = set(path.split(os.sep))
    return not parts.isdisjoint(IGNORE_DIRS)

def process_file(filepath):
    with open(filepath, "r", encoding="utf-8", errors="ignore") as f:
        content = f.read()

    new_content = content.replace("ws://", "wss://")
    new_content = new_content.replace("http://", "https://")

    if new_content != content:
        with open(filepath, "w", encoding="utf-8") as f:
            f.write(new_content)
        print(f"Updated: {filepath}")

for root, dirs, files in os.walk(ROOT_DIR):
    if should_skip(root):
        continue

    for file in files:
        if any(file.endswith(ext) for ext in TARGET_EXT):
            full_path = os.path.join(root, file)
            process_file(full_path)

print("Done.")
相关推荐
91刘仁德7 小时前
HTTPS 加密原理与 CA 数字证书:从对称加密到完整通信流程
网络·笔记·网络协议·http·https
豆豆21 小时前
2026 年建站架构选型实录:从 SC-081v3 证书新政与备案新规倒推 CMS 选型口径
架构·https·cms·geo·acme·web架构·pageadmin
Lsetea1 天前
OpenSSL verify报invalid CA certificate:basicConstraints与keyCertSign排查
运维·https·ssl证书·openssl·证书链
勇往直前plus1 天前
HTTPS 详解
网络协议·http·https
Lsetea2 天前
OpenSSL verify报error 62:证书主机名不匹配与-verify_hostname排查
运维·https·ssl证书·openssl·san
傲世仙尊2 天前
从HTTPS到MySQL-会话保持的攻防与数据库的真面目
数据库·mysql·https
Lsetea2 天前
OpenSSL verify报certificate signature failure:error 7与证书签名排查
运维·https·ssl证书·openssl·证书链
Zelman3 天前
HTTPS 协议
网络协议·https
姜鱼问生3 天前
HTTPS 部署实战:未备案域名 + 非标端口的完整方案
linux·https
Lsetea3 天前
ACME DNS-01报NXDOMAIN:_acme-challenge记录与权威DNS排查
https·dns·ssl证书·acme·dns-01