Comments (8)
如果项目部署在服务器上,想要录制我浏览器上的请求需要怎么配置呢? ip填服务器的ip, 端口填7778 ? 本地录制还是远端呢? 本地还会启动一个vpn 用于访问内网私有域名
ip填服务器的ip, 端口填7778,在远端录制,本地访问的流量走远端的服务器代理,现在我这边部署在云服务器体验有问题,可以自己部署在本地再试试,然后本地网络设置代理走ip 127.0.0.1 端口 7778
from lunarlink.
好的, 你服务器部署的好像7778 端口没开,我自己本地部署试一下吧
from lunarlink.
好的, 你服务器部署的好像7778 端口没开,我自己本地部署试一下吧
云服务器配置比较差就没开了
from lunarlink.
好的, 你服务器部署的好像7778 端口没开,我自己本地部署试一下吧
您是专门做量化交易的?
from lunarlink.
不是,和你是同行,之前研究过,韭菜一个,还在山顶上没下来呢
from lunarlink.
不是,和你是同行,之前研究过,韭菜一个,还在山顶上没下来呢
😂
from lunarlink.
流量录制生成测试用例失败:
curl 'http://127.0.0.1:8000/api/lunarlink/record_case' \
-H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'Authorization: eyJ0eXAiOiJKV1QiLCFkbWluQHFxLmNvbSIYONI' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Referer: http://127.0.0.1:8888/' \
-H 'Project: 1' \
-H 'sec-ch-ua-platform: "Windows"' \
--data-raw '{"name":"3","length":1,"project":1,"case_dir":2,"api_dir":"","config":{"body":{"name":"chatbot-default","method":"config"}},"requests":[{"url":"https://baidu.com/userWebApi/user/userInfoDetail","body":"{\n \"protalType\": 3\n}","request_method":"POST","request_headers":{"Host":"baidu.com","Connection":"keep-alive","Content-Length":"16","Pragma":"no-cache","Cache-Control":"no-cache","sec-ch-ua":"\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Google Chrome\";v=\"122\"","Content-Type":"application/json;charset=UTF-8","sec-ch-ua-mobile":"?0","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36","token":"47a01c82-5b0d-469b-81be-7d2910da8b54","origin-cors":"5g","sec-ch-ua-platform":"\"Windows\"","Accept":"*/*","Origin":"https://baidu.com","Sec-Fetch-Site":"same-origin","Sec-Fetch-Mode":"cors","Sec-Fetch-Dest":"empty","Referer":"https://baidu.com/move-csp/home","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","X-Forwarded-For":"127.0.0.1"},"response_headers":{"Server":"nginx","Date":"Fri, 29 Mar 2024 07:10:22 GMT","Content-Type":"application/json","Transfer-Encoding":"chunked","Connection":"keep-alive","Vary":"Accept-Encoding","Access-Control-Allow-Methods":"GET,POST","Access-Control-Max-Age":"3600","Access-control-Allow-Origin":"https://baidu.com","Content-Encoding":"gzip"},"cookies":{},"request_cookies":{},"response_content":"{\n \"code\": 0,\n \"data\": {\n \"id\": 120,\n \"userId\": \"2989827898\",\n \"userName\": \"测试验证\",\n \"phone\": \"18071531869\",\n \"platformType\": null,\n \"name\": \"测试验证\",\n \"token\": \"47a01c82-5b0d-469b-81be-7d2910da8b54\",\n \"mail\": \"[email protected]\",\n \"emailActivated\": 0,\n \"userImgUuid\": null,\n \"userType\": 1,\n \"personAuthStatus\": 3,\n \"enterpriseAuthStatus\": 3,\n \"authStatus\": 3,\n \"registerTime\": \"2023-03-28T06:26:12.000+00:00\",\n \"userStatus\": 1,\n \"auditRemark\": \"\",\n \"approvalStatus\": 3,\n \"remark\": null,\n \"certificateList\": [\n \"10001\",\n \"10002\",\n \"10006\"\n ],\n \"permissions\": \"1,2\",\n \"loginAddress\": null\n },\n \"msg\": null,\n \"currentTime\": \"2024-03-29T07:10:22.995+00:00\",\n \"traceId\": \"Ignored_Trace\"\n}","status_code":200,"id":2}]}'
2024-03-29 15:19:58,401 [4cfaf6037fb24ce5813c287e52f84188] django.request ERROR [pid:28296] [log.py->log_response:224] Internal Server Error: /api/lunarlink/record_case
Traceback (most recent call last):
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\views\generic\base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception
raise exc
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper
return bound_method(*args, **kwargs)
File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\decorator.py", line 38, in inner_wrapper
return func(request, *args, **kwargs)
File "E:\PythonCode\LunarLink\backend\apps\lunarlink\views\suite.py", line 616, in post
record_case, api_instances = CaseGenerator.generate_case(
File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\request\generator.py", line 150, in generate_case
CaseGenerator.append_extract(request_data, api_info_map, k, v, "form")
File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\request\generator.py", line 251, in append_extract
variables = CaseGenerator.extract_variables(item_value)
File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\request\generator.py", line 87, in extract_variables
matches = re.findall(r"\$http_res_(\d+)_(.*?)::(.+)", input_string)
File "C:\Users\issuser\AppData\Local\Programs\Python\Python39\lib\re.py", line 241, in findall
return _compile(pattern, flags).findall(string)
TypeError: expected string or bytes-like object
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\base.py", line 183, in _get_response
response = self.process_exception_by_middleware(e, request)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\base.py", line 339, in process_exception_by_middleware
response = middleware_method(request, exception)
File "E:\PythonCode\LunarLink\backend\backend\utils\middleware.py", line 121, in process_exception
qy_message.send(msg=message_dict)
File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\qy_message.py", line 67, in send
res = requests.post(url=webhook, headers=header, json=data).json()
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\sessions.py", line 573, in request
prep = self.prepare_request(req)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\sessions.py", line 484, in prepare_request
p.prepare(
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\models.py", line 368, in prepare
self.prepare_url(url, params)
File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\models.py", line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL '': No scheme supplied. Perhaps you meant https://?
2024-03-29 15:19:58,481 [4cfaf6037fb24ce5813c287e52f84188] django.server ERROR [pid:28296] [basehttp.py->log_message:161] "POST /api/lunarlink/record_case HTTP/1.1" 500 27940
不是很理解 generator 的151 行,json 的时候为什么还是form, debug 了一会没看出来问题, 上面是直接新建项目进行录制然后生成用例的报错, 看起来是在http_res 正则的时候出现了问题
from lunarlink.
流量录制生成测试用例失败:
curl 'http://127.0.0.1:8000/api/lunarlink/record_case' \ -H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \ -H 'sec-ch-ua-mobile: ?0' \ -H 'Authorization: eyJ0eXAiOiJKV1QiLCFkbWluQHFxLmNvbSIYONI' \ -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/plain, */*' \ -H 'Referer: http://127.0.0.1:8888/' \ -H 'Project: 1' \ -H 'sec-ch-ua-platform: "Windows"' \ --data-raw '{"name":"3","length":1,"project":1,"case_dir":2,"api_dir":"","config":{"body":{"name":"chatbot-default","method":"config"}},"requests":[{"url":"https://baidu.com/userWebApi/user/userInfoDetail","body":"{\n \"protalType\": 3\n}","request_method":"POST","request_headers":{"Host":"baidu.com","Connection":"keep-alive","Content-Length":"16","Pragma":"no-cache","Cache-Control":"no-cache","sec-ch-ua":"\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Google Chrome\";v=\"122\"","Content-Type":"application/json;charset=UTF-8","sec-ch-ua-mobile":"?0","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36","token":"47a01c82-5b0d-469b-81be-7d2910da8b54","origin-cors":"5g","sec-ch-ua-platform":"\"Windows\"","Accept":"*/*","Origin":"https://baidu.com","Sec-Fetch-Site":"same-origin","Sec-Fetch-Mode":"cors","Sec-Fetch-Dest":"empty","Referer":"https://baidu.com/move-csp/home","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"zh-CN,zh;q=0.9,en;q=0.8","X-Forwarded-For":"127.0.0.1"},"response_headers":{"Server":"nginx","Date":"Fri, 29 Mar 2024 07:10:22 GMT","Content-Type":"application/json","Transfer-Encoding":"chunked","Connection":"keep-alive","Vary":"Accept-Encoding","Access-Control-Allow-Methods":"GET,POST","Access-Control-Max-Age":"3600","Access-control-Allow-Origin":"https://baidu.com","Content-Encoding":"gzip"},"cookies":{},"request_cookies":{},"response_content":"{\n \"code\": 0,\n \"data\": {\n \"id\": 120,\n \"userId\": \"2989827898\",\n \"userName\": \"测试验证\",\n \"phone\": \"18071531869\",\n \"platformType\": null,\n \"name\": \"测试验证\",\n \"token\": \"47a01c82-5b0d-469b-81be-7d2910da8b54\",\n \"mail\": \"[email protected]\",\n \"emailActivated\": 0,\n \"userImgUuid\": null,\n \"userType\": 1,\n \"personAuthStatus\": 3,\n \"enterpriseAuthStatus\": 3,\n \"authStatus\": 3,\n \"registerTime\": \"2023-03-28T06:26:12.000+00:00\",\n \"userStatus\": 1,\n \"auditRemark\": \"\",\n \"approvalStatus\": 3,\n \"remark\": null,\n \"certificateList\": [\n \"10001\",\n \"10002\",\n \"10006\"\n ],\n \"permissions\": \"1,2\",\n \"loginAddress\": null\n },\n \"msg\": null,\n \"currentTime\": \"2024-03-29T07:10:22.995+00:00\",\n \"traceId\": \"Ignored_Trace\"\n}","status_code":200,"id":2}]}'2024-03-29 15:19:58,401 [4cfaf6037fb24ce5813c287e52f84188] django.request ERROR [pid:28296] [log.py->log_response:224] Internal Server Error: /api/lunarlink/record_case Traceback (most recent call last): File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\views\generic\base.py", line 70, in view return self.dispatch(request, *args, **kwargs) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 509, in dispatch response = self.handle_exception(exc) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception raise exc File "E:\PythonCode\LunarLink\.venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\utils\decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\decorator.py", line 38, in inner_wrapper return func(request, *args, **kwargs) File "E:\PythonCode\LunarLink\backend\apps\lunarlink\views\suite.py", line 616, in post record_case, api_instances = CaseGenerator.generate_case( File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\request\generator.py", line 150, in generate_case CaseGenerator.append_extract(request_data, api_info_map, k, v, "form") File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\request\generator.py", line 251, in append_extract variables = CaseGenerator.extract_variables(item_value) File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\request\generator.py", line 87, in extract_variables matches = re.findall(r"\$http_res_(\d+)_(.*?)::(.+)", input_string) File "C:\Users\issuser\AppData\Local\Programs\Python\Python39\lib\re.py", line 241, in findall return _compile(pattern, flags).findall(string) TypeError: expected string or bytes-like object During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\base.py", line 183, in _get_response response = self.process_exception_by_middleware(e, request) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\django\core\handlers\base.py", line 339, in process_exception_by_middleware response = middleware_method(request, exception) File "E:\PythonCode\LunarLink\backend\backend\utils\middleware.py", line 121, in process_exception qy_message.send(msg=message_dict) File "E:\PythonCode\LunarLink\backend\apps\lunarlink\utils\qy_message.py", line 67, in send res = requests.post(url=webhook, headers=header, json=data).json() File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, **kwargs) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\sessions.py", line 573, in request prep = self.prepare_request(req) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\sessions.py", line 484, in prepare_request p.prepare( File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\models.py", line 368, in prepare self.prepare_url(url, params) File "E:\PythonCode\LunarLink\.venv\lib\site-packages\requests\models.py", line 439, in prepare_url raise MissingSchema( requests.exceptions.MissingSchema: Invalid URL '': No scheme supplied. Perhaps you meant https://? 2024-03-29 15:19:58,481 [4cfaf6037fb24ce5813c287e52f84188] django.server ERROR [pid:28296] [basehttp.py->log_message:161] "POST /api/lunarlink/record_case HTTP/1.1" 500 27940不是很理解 generator 的151 行,json 的时候为什么还是form, debug 了一会没看出来问题, 上面是直接新建项目进行录制然后生成用例的报错, 看起来是在http_res 正则的时候出现了问题
克隆最新代码试试,已经修复了这个问题
from lunarlink.
Related Issues (15)
- 运行迁移命令报错,大佬给看下呗 HOT 1
- 列表不展示内容,添加了接口,目录只有数量 HOT 3
- docker部署容器内执行python3 manage.py migrate指令报错,mysql:8.0.21容器启动报错了 HOT 18
- 能否提供showdoc的导入呢? HOT 1
- 作者你好,为啥不支持post请求的录制 HOT 3
- yapi导入异常 HOT 4
- 增加对gRPC类型的接口支持 HOT 1
- 能否创建个群聊 HOT 1
- 增加生成单接口测试用例的功能 HOT 1
- 通过docker部署,lunar-link-proxy容器状态一直显示 restarting HOT 1
- 为啥我搭建的跟示例不一样 HOT 1
- 我这个账号绑定了一个有所有权限的分组,为啥登录后侧边菜单还是无法点击呐,数据库也对上了 HOT 3
- 登录日志无法显示 HOT 1
- 触发定时任务时候,总是提示以下错误。单独运行用例的时候就可以,不知道是什么情况
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lunarlink.