Commit 558e59f 1 parent 63cc9d2 commit 558e59f Copy full SHA for 558e59f
File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 23
23
service = 7
24
24
25
25
# Prior to receiving anything register the local service endpoint
26
- register = urllib .request .urlopen ("http://127.0.0.1:3000/register?" + service ).read ()
26
+ register = urllib .request .urlopen ("http://127.0.0.1:3000/register?" + str ( service ) ).read ()
27
27
print (register )
28
28
29
29
def on_open (ws ):
@@ -43,14 +43,16 @@ def on_message(ws, message):
43
43
if message == "200 tx mode: data" :
44
44
print ("mode changed to `data`" )
45
45
# after the mode was set we subscribe to the echo service previously registered
46
+ if local_node .startswith ('ipn' ):
47
+ service = "{}.{}" .format (local_node .split ("." )[0 ], service )
46
48
ws .send ("/subscribe " + service )
47
49
elif message == "200 subscribed" :
48
- print ("succesfully subscribed" )
50
+ print ("successfully subscribed" )
49
51
# after subscribing we are ready to receive bundles
50
52
recv_data = True
51
53
else :
52
54
if message [0 :3 ] == '200' :
53
- # text messages starting with '200' inidicate successful transmission
55
+ # text messages starting with '200' indicate successful transmission
54
56
print ("sent reply" )
55
57
else :
56
58
#hexstr = "".join(format(i, "02x") for i in message)
You can’t perform that action at this time.
0 commit comments