Thank you for the quick response,apologies for the flipped question.For some reason ios browser flipped it.
I think the best way to avoid such casts on godot is to implement it using GDScript (godot scripting language similar to python).
I will leave the thread open just in case anyone implements it in the future, but i will attempt to do this as websockets are now available on the godot engine out of the box(development version 3.1-dev).