Frp: How to trigger events/notifications in frp server when it detected one of the client is offline?

Created on 8 Apr 2019  ·  5Comments  ·  Source: fatedier/frp

Hi,

Currently I have implemented frp communication between 5 clients and 1 server.

So far everythings are working fine.

However, I can't trigger events/notifications in frp server when it detected one of client is offline.

This is because I can only know the client is down when error displayed inside the logs.

So, how could I do to trigger events/notifications to another website/application so that I could display this error details and subsequently proceed backup action or etc?

Thanks.

All 5 comments

frps support API for getting proxies status such as /api/proxy/tcp.

You can try to call this API at intervals to check proxies status and do what you want.

frps support API for getting proxies status such as /api/proxy/tcp.

You can try to call this API at intervals to check proxies status and do what you want.

Any documentation on this API section?

For example:
My frps server domain name is http://example.com/

So I could check proxies status via http://example.com/api/proxy/tcp?

Thanks.

You should set dashboard params to enable this feature.

# frps.ini
[common]
dashboard_addr = 0.0.0.0
dashboard_port = 7500

# dashboard user and passwd for basic auth protect, if not set, both default value is admin
dashboard_user = admin
dashboard_pwd = admin

The api is http://127.0.0.1:7500/api/proxy/tcp.

It's designed to display data on dashboard, no documentation now, maybe future.

You should set dashboard params to enable this feature.

# frps.ini
[common]
dashboard_addr = 0.0.0.0
dashboard_port = 7500

# dashboard user and passwd for basic auth protect, if not set, both default value is admin
dashboard_user = admin
dashboard_pwd = admin

The api is http://127.0.0.1:7500/api/proxy/tcp.

It's designed to display data on dashboard, no documentation now, maybe future.

Tested it is working, and it returns JSON data for all my clients.

But how could I do the authentication step entered with username admin and password admin when calling this API from my application side?

In my PC, it would pop up a screen to prompt input of dashboard username and password. So I could enter these details myself. But impossible for my application to do this step.

Try to search http basic auth for more details.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ne1000 picture ne1000  ·  3Comments

gao270615179 picture gao270615179  ·  3Comments

guodong1994 picture guodong1994  ·  4Comments

yj7778826 picture yj7778826  ·  3Comments

jwangkun picture jwangkun  ·  3Comments