Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
# 模拟监听2000端口的服务 from flask import Flask app = Flask(__name__) @app.route('/v1/hello') def hello(): return 'I`m port 2000' if __name__ == '__main__': app.run(port=2000) # 模拟监听3000端口的服务 from flask import Flask app = Flask(__name__) @app.route('/v2/hello') def hello(): return 'I`m port 3000' if __name__ == '__main__': app.run(port=3000)
/v1/*
/v2/*
wget https://autodl-public.ks3-cn-beijing.ksyuncs.com/tool/api-proxy/proxy_in_instance
config.yaml
proxies: - host_and_port: http://127.0.0.1:2000 # 要代理到的服务地址 route_path: /v1/* # 匹配什么路由就转发到此地址 - host_and_port: http://127.0.0.1:3000 # 可设置多组,转发到不同的host route_path: /v2/*
# 如果没下载转发程序,先下载 wget https://autodl-public.ks3-cn-beijing.ksyuncs.com/tool/api-proxy/proxy_in_instance # 如果没有添加可执行权限,先添加权限 chmod +x proxy_in_instance # 启动 ./proxy_in_instance