# Help sharing app on local network

**URL:** <https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [June 14, 2020, 4:15am UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174 "2020-06-14T04:15:56Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 14, 2020, 4:15am UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/1 "2020-06-14T04:15:56Z")

</div>

Hi. I’m trying to share my app on my local network and getting stuck. I have openvidu running locally in the docker container like so…

```
docker run -p 4443:4443 --rm --name openvidu \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOMAIN_OR_PUBLIC_IP=192.168.1.26 \
-e OPENVIDU_SECRET=123 \
openvidu/openvidu-server-kms:2.14.0

```

I created a cert and key with mkcert and I am able to access my app running at `https://192.168.1.26:8001/`.

I am able to access the openvidu dashboard running at `https://192.168.1.26:4443/dashboard/#/` and I am able to start a test session there.

I am able to make api calls from my app to the openvidu server.

But when I try to join a session from my app at I get…

`webSocketWithReconnection.js:14 WebSocket connection to 'wss://192.168.1.26:4443/openvidu' failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID`

Any idea what I’m doing wrong?

Thanks.

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 14, 2020, 7:13pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/2 "2020-06-14T19:13:45Z")

</div>

UPDATE: This is only happening in Chrome. It works in Firefox.

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 15, 2020, 8:29am UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/3 "2020-06-15T08:29:37Z")

</div>

Try opening [https://192.168.1.26:4443/openvidu](https://192.168.1.26:4443/openvidu) in the browser and accepting the certificate. Then go to your app and test it.

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 15, 2020, 5:57pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/4 "2020-06-15T17:57:58Z")

</div>

I am accepting the cert when going to the dashboard.

I also tried manually adding the cert to Keychain Access in Mac. After that I get a different error… `ERR_CERT_COMMON_NAME_INVALID` and `Subject Alternative Name missing`. This seems to be discussed here…

> <https://stackoverflow.com/questions/7580508/getting-chrome-to-accept-self-signed-localhost-certificate>

Is that something you can fix in the openvidu cert?

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 16, 2020, 12:04pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/5 "2020-06-16T12:04:06Z")

</div>

Are you using Docker Desktop for Mac?

If so… why are you using [https://192.168.1.26:4443/openvidu](https://192.168.1.26:4443/openvidu) instead of [https://127.0.0.1:4443/](https://127.0.0.1:4443/)?

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 16, 2020, 5:14pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/6 "2020-06-16T17:14:55Z")

</div>

Yes I am using Docker for Mac. I am trying to share my app on my local network.

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 17, 2020, 10:34pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/7 "2020-06-17T22:34:17Z")

</div>

We haven’t tested that scenario.

Maybe you can generate a valid certificate and regenerate docker image with it.

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 18, 2020, 8:58pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/8 "2020-06-18T20:58:48Z")

</div>

Isn’t this the scenario described in the docs here… [https://docs.openvidu.io/en/2.14.0/troubleshooting/#share-your-app-through-your-network-to-test-with-multiple-devices](https://docs.openvidu.io/en/2.14.0/troubleshooting/#share-your-app-through-your-network-to-test-with-multiple-devices)

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 18, 2020, 10:23pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/9 "2020-06-18T22:23:50Z")

</div>

We have tested with linux and it works. But we never tested on Mac or Windows. Maybe there are some specific details to take into account.

Please share with use if you finally manage to get it working.

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 19, 2020, 4:56pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/10 "2020-06-19T16:56:28Z")

</div>

Did you test Chrome on Linux? Chrome seems to be the only browser having this problem. Also, does the cert used by openvidu have `Subject Alternative Name` applied? That might be the solution for Chrome according to the discussion I linked to above.

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [June 22, 2020, 9:07am UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/11 "2020-06-22T09:07:00Z")

</div>

Yes, Chrome in Linux works fine when sharing openvidu-server-kms docker image over LAN, at least last time I checked. If I remember corretly, I think openvidu-server self-signed certificate was created with a very simple openssl command like this: `openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -subj '//CN=www.mydom.com\O=My Company LTD.\C=US' -keyout key.pem -out cert.pem`

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 27, 2020, 7:46pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/12 "2020-06-27T19:46:45Z")

</div>

Here’s some more info in case it helps track this down.

I was focussed on getting openvidu working so I could test it shared on my local network. But I didn’t realize that using a self-signed cert with https on the local network causes the websockets in my app (not related to openvidu) to fail. My websockets works over http even with the 192 ip). But when I use http and test openvidu, I am able to connect to a session, but then call to `publish` never resolves. So I have something like this…

```
console.log('*** _testVideoSession.publish');
_testVideoSession.publish(_testVideoPublisher)
.then(() => {
   console.log('*** publish ok');
})
.catch((error) => {
  console.log('*** publish error');
});

```

I get nothing after the 1st log. I don’t get `publish ok` or `publish error`. This happens even when testing on my dev machine (not just other machines on the network).

Here’s the output from the server when attempting to publish…

```
2020-06-27 19:12:38,525 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:12:38,524 [0.0-4443-exec-8] io.openvidu.server.rpc.RpcHandler - After connection established for WebSocket session: t0lg18gafvjom695nc42l9hlff

2020-06-27 19:12:38,538 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:12:38,537 [c42l9hlff-e4-t0] io.openvidu.server.core.Session - Token consumed { Session: ses_U26ysCCZQb | Tokens: [wss://192.168.1.26:4443?sessionId=ses_U26ysCCZQb&token=tok_XZBkhCdxeNTy69cQ&role=PUBLISHER&version=2.14.0, wss://192.168.1.26:4443?sessionId=ses_U26ysCCZQb&token=tok_WXxToHPhhVhTT9fE&role=PUBLISHER&version=2.14.0] }

2020-06-27 19:12:38,543 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:12:38,543 [c42l9hlff-e4-t0] io.openvidu.server.core.SessionManager - Participant con_IABidMI6hf of session ses_U26ysCCZQb is a final user connecting to this session for the first time

2020-06-27 19:12:38,549 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:12:38,549 [c42l9hlff-e4-t0] io.openvidu.server.kurento.core.KurentoSessionManager - KMS less loaded is ws://localhost:8888/kurento with a load of 1.0

2020-06-27 19:12:38,552 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:12:38,552 [c42l9hlff-e4-t0] io.openvidu.server.kurento.core.KurentoSessionManager - No session 'ses_U26ysCCZQb' exists yet. Created one on KMS 'kms_VaozABrC' with ip 'localhost'

2020-06-27 19:12:38,560 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:12:38,558 [c42l9hlff-e4-t0] io.openvidu.server.kurento.core.KurentoSession - SESSION ses_U26ysCCZQb: Creating MediaPipeline

2020-06-27 19:12:38,578 DEBG 'kms' stdout output:
0:01:01.302487400 8 0x7fb894001cd0 DEBUG KurentoWebSocketTransport WebSocketTransport.cpp:513:processMessage: Message: {"id":9,"method":"create","params":{"type":"MediaPipeline","constructorParams":{},"properties":{},"sessionId":"c1ec2bf1-1363-4db4-a3e6-3c2e194075c6"},"jsonrpc":"2.0"}

2020-06-27 19:12:38,579 DEBG 'kms' stdout output:
0:01:01.303270300 8 0x7fb894001cd0 DEBUG KurentoWebSocketTransport WebSocketTransport.cpp:515:processMessage: Response: {"id":9,"jsonrpc":"2.0","result":{"sessionId":"c1ec2bf1-1363-4db4-a3e6-3c2e194075c6","value":"1e2fad59-6fce-4614-b606-811e8edca254_kurento.MediaPipeline"}}

2020-06-27 19:12:38,610 DEBG 'kms' stdout output:
0:01:01.334607300 8 0x7fb8780012f0 DEBUG KurentoWebSocketTransport WebSocketTransport.cpp:513:processMessage: Message: {"id":10,"method":"subscribe","params":{"type":"Error","object":"1e2fad59-6fce-4614-b606-811e8edca254_kurento.MediaPipeline","sessionId":"c1ec2bf1-1363-4db4-a3e6-3c2e194075c6"},"jsonrpc":"2.0"}
0:01:01.334853100 8 0x7fb8780012f0 DEBUG KurentoWebSocketTransport WebSocketTransport.cpp:515:processMessage: Response: {"id":10,"jsonrpc":"2.0","result":{"sessionId":"c1ec2bf1-1363-4db4-a3e6-3c2e194075c6","value":"6f8b7482-cdc5-4824-a51e-6f76f8814d82"}}

2020-06-27 19:12:38,629 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:12:38,626 [c42l9hlff-e4-t0] io.openvidu.server.kurento.core.KurentoSession - SESSION ses_U26ysCCZQb: Added participant [participantPrivateId=t0lg18gafvjom695nc42l9hlff, participantPublicId=con_IABidMI6hf, streaming=false]

```

When I run my app in localhost instead of the 192 ip it works. I see the same output as above but then it continues with…

```
2020-06-27 19:09:58,109 DEBG 'openvidu-server' stdout output:
[INFO] 2020-06-27 19:09:58,107 [9umadf1l-e18-t0] io.openvidu.server.rpc.RpcHandler - Participant con_HPV2fJrdq5 is calling method 'publish' in session ses_B4TEZn70rh

2020-06-27 19:09:58,109 DEBG 'kms' stdout output:
0:17:15.432650500 8 0x7f4cc8001d80 DEBUG KurentoWebSocketTransport WebSocketTransport.cpp:513:processMessage: Message: {"id":300,"method":"create","params":{"type":"WebRtcEndpoint","constructorParams":{"mediaPipeline":"c1143201-6321-4a93-8b69-9bd370ed7ad0_kurento.MediaPipeline"},"properties":{},"sessionId":"1ff228b8-7dee-446d-9d75-5f06d333c1dd"},"jsonrpc":"2.0"}

2020-06-27 19:09:58,113 DEBG 'kms' stdout output:
0:17:15.436388400 8 0x7f4cc8001d80 INFO KurentoBaseRtpEndpointImpl BaseRtpEndpointImpl.cpp:114:BaseRtpEndpointImpl: No predefined RTP MTU found in config; using default
0:17:15.436583200 8 0x7f4cc8001d80 INFO KurentoWebRtcEndpointImpl WebRtcEndpointImpl.cpp:104:remove_not_supported_codecs_from_array:<kmswebrtcendpoint4> Removing not supported codec 'AMR/8000'
0:17:15.436674900 8 0x7f4cc8001d80 INFO KurentoWebRtcEndpointImpl WebRtcEndpointImpl.cpp:521:WebRtcEndpointImpl: No predefined external IP address found in config; you can set one or default to STUN automatic discovery
0:17:15.436732500 8 0x7f4cc8001d80 INFO KurentoWebRtcEndpointImpl WebRtcEndpointImpl.cpp:532:WebRtcEndpointImpl: No predefined network interfaces found in config; you can set one or default to ICE automatic discovery

```

This is the same in any browser I’ve tried.

Does this help find the issue, since it’s not related to my cert or sharing on the local network. It seems to just be caused by using the 192 ip. Do the logs or the fact that the publish method never resolves help?

Thanks again.

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 29, 2020, 5:08pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/13 "2020-06-29T17:08:21Z")

</div>

If it is working on Firefox and not in Chrome, it is maybe related with how the browser manages self-signed certificates.

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [June 30, 2020, 12:39am UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/14 "2020-06-30T00:39:38Z")

</div>

This is happening in both Chrome and Firefox. The issue that was only happening in Chrome was when I was using https.

---

<div class="post-metadata">

**Author:** ![Adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@Adam](https://openvidu.discourse.group/u/Adam)\
**Post date:** [July 5, 2020, 7:47pm UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/15 "2020-07-05T19:47:08Z")

</div>

Update… I found that the call to `initPublisher` is resulting in an error… `TypeError: navigator.mediaDevices is undefined`

Any other advice on this? To summarize… when I run my app locally with [http://192.168](http://192.168)… I get the error above when calling `initPublisher` and the the call to `session.publish` never resolves at all.

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [July 8, 2020, 9:46am UTC](https://openvidu.discourse.group/t/help-sharing-app-on-local-network/1174/16 "2020-07-08T09:46:13Z")

</div>

navigator.mediaDevices is undefined if you are not serving your web app on https

BRowsers eliminate Media Devices API on HTTP. So you can’t access the object: [https://docs.openvidu.io/en/2.15.0/troubleshooting/#10-my-local-video-is-not-showing-up-on-the-browser](https://docs.openvidu.io/en/2.15.0/troubleshooting/#10-my-local-video-is-not-showing-up-on-the-browser)
