FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdks/examples/webhook.py at main · livekit/python-sdks · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
livekit
/
python-sdks
Public
Notifications
You must be signed in to change notification settings
Fork
132
Star
380
Code
Issues
16
Pull requests
28
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-sdks
/
examples
/
webhook.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (16 loc) · 614 Bytes
Breadcrumbs
python-sdks
/
examples
/
webhook.py
Copy path
File metadata and controls
23 lines (16 loc) · 614 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from
livekit
import
api
from
aiohttp
import
web
async
def
handle_webhook
(
request
):
token_verifier
=
api
.
TokenVerifier
()
webhook_receiver
=
api
.
WebhookReceiver
(
token_verifier
)
auth_token
=
request
.
headers
.
get
(
"Authorization"
)
if
not
auth_token
:
return
web
.
Response
(
status
=
401
)
body
=
await
request
.
read
()
event
=
webhook_receiver
.
receive
(
body
.
decode
(
"utf-8"
),
auth_token
)
print
(
"received event:"
,
event
)
return
web
.
Response
(
status
=
200
)
if
__name__
==
"__main__"
:
app
=
web
.
Application
()
app
.
router
.
add_post
(
"/"
,
handle_webhook
)
web
.
run_app
(
app
,
port
=
3000
)
Back
|
FazBrowse Home
|
New Git URL