跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[问与答] clash restful api 调用失败 求大家给点思路

发表于

我想通过 python 调用 clash restful api 但是报错连接失败 大家能帮我看看是什么问题吗,找不到原因

下面是我的 clash 配置文件和 python 代码

参考了这个链接: https://clash.gitbook.io/doc/restful-api

clash:

mixed-port: 7890
allow-lan: true
bind-address: '*'
mode: global
log-level: info
external-controller: '127.0.0.1:9090'
secret: 29c0c9ba-1740-42c0-bb8c-dd316c5d1e4a

python:

import requests

url = 'http://127.0.0.1:9090/proxies'
secret = "29c0c9ba-1740-42c0-bb8c-dd316c5d1e4a"

headers = {
    'Authorization': f'Bearer {secret}'
}

print(requests.get(url, headers=headers).json())

报错: requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=9090): Max retries exceeded with url: /proxies (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10580fb90>: Failed to establish a new connection: [Errno 61] Connection refused'))

我的网络状态是正常的,clash 也能正常使用,但是 restful api 调用不了,大家有什么解决思路吗,先谢谢了

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.