codex服务器运用(服务器上不了外网chatgpt)

让服务器通过 MobaXterm 反向连接到笔记本的 7897 端口。

测试服务器端口

bash 复制代码
Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | Select-Object ProxyEnable, ProxyServer

显示为:

c 复制代码
ProxyEnable ProxyServer
----------- -----------
          1 127.0.0.1:7897

MobaXterm 本地终端写入:

bash 复制代码
ssh -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes -R 7890:127.0.0.1:7897 r@192.168.10.xxx

liunx服务器写入命令:

bash 复制代码
export HTTP_PROXY="http://127.0.0.1:7890"
export HTTPS_PROXY="http://127.0.0.1:7890"
export ALL_PROXY="http://127.0.0.1:7890"

测试:

bash 复制代码
curl -I https://api.openai.com --connect-timeout 15
curl -I https://chatgpt.com --connect-timeout 15
c 复制代码
只要不再出现:

Failed to connect to 127.0.0.1 port 7890

就说明服务器已经能通过笔记本的代理出网了。

然后启动 Codex

bash 复制代码
cd /home/r/work/codex_test
bash 复制代码
codex --sandbox workspace-write --ask-for-approval on-request
相关推荐
SkyWalking中文站9 小时前
认识 Horizon UI · 6/17:Trace 探索器
运维·监控·自动化运维
Augustzero12 小时前
Codex Desktop 新建会话无法发送消息:一次由旧版 CLI 路径引发的故障排查
chatgpt·agent
程序员老赵12 小时前
服务器文件不想 SFTP 上传?Docker 跑个 File Browser,浏览器就能管理
服务器·docker·开源
火车叼位12 小时前
写给初级开发者:SSL、SSH、HTTPS 与证书体系全解析
运维
vivo互联网技术17 小时前
从 10 分钟到 1 秒:ES 深度分页任意跳页的三轮优化实战
服务器·数据库·redis·elasticsearch·深度分页
小猿姐1 天前
唯品会大规模数据库云原生实践:基于 KubeBlocks 管理数千实例的统一运维之路
运维·elasticsearch·云原生
SkyWalking中文站2 天前
认识 Horizon UI · 5/17:3D 基础设施地图
运维·监控·自动化运维
xn71332 天前
ChatGPT 生图如何自动导入 Astro 内容站:base64 桥接、frontmatter 更新和封面校验
chatgpt
SkyWalking中文站2 天前
认识 Horizon UI · 1/17:SkyWalking 新一代可观测性控制台
运维·前端·监控