Is possible use Shared drawing canvas (example code) on P5.js (IPad)?

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)