#create a sphere
sphere = hou.node("/obj").createNode("geo", "sphere")
for child in sphere.children(): child.destroy()
sphere.createNode('sphere')
script_node = 'sphere = hou.node("/obj/sphere")\ncoord = str(sphere.parm("tx").eval()) + " " + str(sphere.parm("ty").eval())\nprint coord\n\n#send to UDP server\nhou.session.s.sendto(coord, hou.session.server)'
#create script node and input script text
pythonscript = hou.node('/obj').createNode("pythonscript", "pythonscript")
pythonscript.parm('python').set(script_node)
pythonscript.setPosition([0,-1])
UDP_client = 'import socket\n\nhost = "localhost"\nport = 44447\nserver = ("localhost", 44444)\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\ns.bind((host, port))'
#create the UDP client and start it running
hou.appendSessionModuleSource(UDP_client)
start node.js server
open external web page: http://ds604.neocities.org/houdiniBridge/externalPage.html