Chrome 67 webgl exception on AddWebsocketHost

Hello everyone
I want to develop webgl websocket client and use Unity LLAPI

Here is code

var config = new ConnectionConfig();
var topology = new HostTopology(config, 4);
m_HostId = NetworkTransport.AddWebsocketHost(topology, 8889);
byte error;
connectionId = NetworkTransport.Connect(1, "*my ip here", 443, 0, out error);

This work fine in Editor but if i open page with webgl in my chrome 67, ive got error:

Initializing network transport

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

NotImplementedException: this function cannot be called on web browser

at UnityEngine.Networking.NetworkTransport.AddWebsocketHost (UnityEngine.Networking.HostTopology topology, Int32 port) [0x00000] in :0

(Filename: currently not available on il2cpp Line: -1)

What i did wrong?

You can not create a listening socket in a webplayer. This is impossible as WebGL runs inside the security sandbox of the browser. As you can read in the documentation of NetworkTransport.AddWebsocketHost this does only work in the editor or standalone builds. WebGL applications have to communicate either through gameservers you provide or through the webserver where you hosted your game.

Read this page, especially the section about WebGL. “AddWebsocketHost” should only be called on the server which can not be a WebGL build. On the client you should use the normal AddHost.

You can use WebSockets on WebGL,
however web clients can only connect
to hosts, they cannot be a host
themselves. This means the host must
be a standalone player (Win, Mac or
Linux only). For client-side
configuration, all steps described
above (including topology and
configuration) are the same. On the
server, call the following:

NetworkTransport.AddWebsocketHost(topology, port, ip);

So AddWebsocketHost can and should only be called on the server.

Thanks… I thought this func create virtual host with no ip, so no any port is listening (excually netstat shows listening), but created host allow to make websocket connection to remote server. I’ve call this func without ip argument.
So, what class i should use to webgl websocket client? Ive tried NetworkClient, but its work only with UDP and my attempts to configure it to websocket was failed. Is possibly way only through javascripts code?