安装Node.js: npm install 启动应用: node v2rayn.js 配置配置文件: 创建或编辑 config/v2rayn.js,添加每个节点的配置,每个节点的配置包含 name、ip、port、radius、width、height、depth、width_ratio 和 resolution。...
-
安装Node.js:
npm install
-
启动应用:
node v2rayn.js
-
配置配置文件: 创建或编辑
config/v2rayn.js,添加每个节点的配置,每个节点的配置包含name、ip、port、radius、width、height、depth、width_ratio和resolution。示例配置:
const config = { "nodes": [ { "name": "node", "ip": "192.168.1.1", "port": 3, "radius": 5, "width": 8, "height": 6, "depth": 1, "width_ratio": 16:9, "resolution": "high" } ] }; -
启动应用:
node v2rayn.js -D config
-
配置环境变量:
export V2RAYN NODE_IP=192.168.1.1 export V2RAYN NODE_PORT=3
-
配置参数(如果需要):
radius: 节点的半径width: 视图的宽度height: 视图的高度depth: 模型深度width_ratio: 视图的水平比例resolution: 显卡分辨率
-
启动应用:
node v2rayn.js -D config
-
测试配置:
- 打开浏览器,访问
http://localhost:3/ - 打开 Three.js 或其他3D渲染器,查看节点的配置是否正确
- 打开浏览器,访问
注意:
- 确保所有配置文件都存在于
node_modules/config目录中。 - 如果需要动态配置,可以使用 Node.js 的
serve或node_modules的serve工具。 - 调整配置参数时,确保数值合理,避免运行错误。
通过以上步骤,您应能够正确配置和启动 v2rayN 节点。

相关文章








