Is possible Shared drawing canvas between Processing (on MAC) and P5.js?

Hello everybody,
I want do the example of the Network Library of Processing “Shared drawing canvas” using my MAC with the processing code as a server and my IPad with Processing.app (p5.js) as a client, how can this be done?
I tried to copy the client part of the code into P5.js but it gives me error, probably import processing.net. * Not working
Thanks so much!!

P.S. the code is this Network / Processing.org (example 2)