clienttest.py 340 B

123456789101112131415161718
  1. import rpyc
  2. import time
  3. from fastapi import FastAPI
  4. import sys
  5. import os
  6. app = FastAPI()
  7. @app.get("/domain/{domain_name}")
  8. async def read_item(domain_name):
  9. conn = rpyc.connect("localhost",12345)
  10. jsdata=conn.root.get_url('http://headers.jsontest.com/')
  11. return jsdata
  12. # print(jsdata)
  13. # return {"item_id": domain_name}