Skip to content

Commit ea536f2

Browse files
committed
ripe-stream.py
1 parent b2690d5 commit ea536f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ripe-stream.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import radix
99
import websocket
1010

11-
url = "wss://ris-live.ripe.net/v1/ws/?client=username_at_example_com"
11+
## Uncomment and update this with a unique identifier for the RIPE team
12+
#url = "wss://ris-live.ripe.net/v1/ws/?client=username_at_example_com"
1213

1314
tree = radix.Radix()
1415

@@ -32,6 +33,7 @@
3233
while True:
3334
ws = websocket.WebSocket()
3435
ws.connect(url)
36+
# subscribe to all BGP Updates
3537
ws.send(json.dumps({"type": "ris_subscribe", "data": {"type": "UPDATE"}}))
3638
try:
3739
for data in ws:
@@ -48,6 +50,7 @@
4850
print("search_best: %s returned " % prefix, e)
4951
if rnode is not None and rnode.data['metadata'] is not None:
5052
as_path = ' '.join(str(x) for x in parsed_data.get('path', None))
53+
# Is it a more specific?
5154
if prefix != rnode.prefix:
5255
sub_prefix = "Yes"
5356
else:

0 commit comments

Comments
 (0)