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.")
相关推荐
杨凯凡1 天前
【002】HTTPS 粗解:证书、TLS 握手与对后端配置的影响
网络协议·http·https
AI_Claude_code1 天前
ZLibrary访问困境方案二:DNS-over-HTTPS/TLS配置与隐私保护实践
爬虫·python·网络协议·http·网络安全·https·网络爬虫
邓霖涛1 天前
nginx使用openSSL自签生成https相关证书
服务器·nginx·https
洒家肉山大魔王2 天前
PKI/CA X.509证书的基础应用与解读
服务器·https·密码学·数字证书
前端 贾公子2 天前
Vite 开发环境配置 HTTPS
网络协议·http·https
懒大王95272 天前
http和https的异同点和优缺点
网络协议·http·https
snow@li3 天前
协议:应用层开发都会涉及哪些协议 / 详细整理 / http、ws、https、wss
网络协议·http·https
952363 天前
网络原理 - HTTP / HTTPS
网络·http·https
hzxpaipai4 天前
英语+越南语网站架构设计:派迪科技多语言建站实践解析
网络·科技·物联网·网络安全·https
2501_915921434 天前
uni-app一键生成iOS安装包并上传TestFlight全流程
android·ios·小程序·https·uni-app·iphone·webview