Skip to content

Commit

Permalink
Code autogenerated from Kurento/doc-kurento@825b56e
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkinskurento committed Jun 14, 2021
1 parent 903afad commit 696afec
Show file tree
Hide file tree
Showing 214 changed files with 440 additions and 400 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#/
#/ This shell script prepares the sources for building. The main work done here
#/ is replacing all placeholder variables with their actual values, as defined
#/ in 'VERSIONS.conf.sh'.
#/ in 'VERSIONS.env'.
#/
#/ Arguments: None.

Expand Down Expand Up @@ -37,12 +37,12 @@ log() { echo "[$BASENAME] $*"; }
# ---- Load VERSIONS file ----

BASEPATH="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" # Absolute canonical path
CONF_FILE="$BASEPATH/VERSIONS.conf.sh"
CONF_FILE="$BASEPATH/VERSIONS.env"
[[ -f "$CONF_FILE" ]] || {
log "ERROR: Shell config file not found: $CONF_FILE"
exit 1
}
# shellcheck source=VERSIONS.conf.sh
# shellcheck source=VERSIONS.env
source "$CONF_FILE"


Expand Down
14 changes: 7 additions & 7 deletions source/dev/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ For this reason, the documentation must be built only after all the other module

Job *doc-kurento* -> job *doc-kurento-readthedocs* -> `New build at Read the Docs`_.

#. Edit `VERSIONS.conf.sh`_ to set all relevant version numbers: version of the documentation itself, and all referred modules and client libraries.
#. Edit `VERSIONS.env`_ to set all relevant version numbers: version of the documentation itself, and all referred modules and client libraries.

These numbers can be different because not all of the Kurento projects are necessarily released with the same frequency. Check each one of the Kurento repositories to verify what is the latest version of each one, and put it in the corresponding variable:

Expand All @@ -940,7 +940,7 @@ For this reason, the documentation must be built only after all the other module
- ``[VERSION_TUTORIAL_JS]``: Repo `kurento-tutorial-js`_.
- ``[VERSION_TUTORIAL_NODE]``: Repo `kurento-tutorial-node`_.

#. In *VERSIONS.conf.sh*, set *VERSION_RELEASE* to **true**. Remember to set it again to *false* after the release, when starting a new development iteration.
#. In *VERSIONS.env*, set *VERSION_RELEASE* to **true**. Remember to set it again to *false* after the release, when starting a new development iteration.

#. Test the build locally, check everything works.

Expand All @@ -956,7 +956,7 @@ For this reason, the documentation must be built only after all the other module
# `--all` to include possibly deleted files.
git add --all \
VERSIONS.conf.sh \
VERSIONS.env \
source/project/relnotes/ \
&& git commit -m "$COMMIT_MSG" \
&& git push \
Expand Down Expand Up @@ -985,12 +985,12 @@ For this reason, the documentation must be built only after all the other module
local COMMIT_MSG="Prepare for next development iteration"
# Set [VERSION_RELEASE]="false"
sed -r -i 's/\[VERSION_RELEASE\]=.*/[VERSION_RELEASE]="false"/' VERSIONS.conf.sh \
sed -r -i 's/\[VERSION_RELEASE\]=.*/[VERSION_RELEASE]="false"/' VERSIONS.env \
|| { echo "ERROR: Command failed: sed"; return 1; }
# Set [VERSION_DOC]
local VERSION_DOC="${NEW_VERSION}-dev"
sed -r -i "s/\[VERSION_DOC\]=.*/[VERSION_DOC]=\"$VERSION_DOC\"/" VERSIONS.conf.sh \
sed -r -i "s/\[VERSION_DOC\]=.*/[VERSION_DOC]=\"$VERSION_DOC\"/" VERSIONS.env \
|| { echo "ERROR: Command failed: sed"; return 2; }
# Add a new Release Notes document
Expand All @@ -1004,7 +1004,7 @@ For this reason, the documentation must be built only after all the other module
|| { echo "ERROR: Command failed: sed"; return 3; }
git add \
VERSIONS.conf.sh \
VERSIONS.env \
source/project/relnotes/ \
&& git commit -m "$COMMIT_MSG" \
&& git push \
Expand All @@ -1029,7 +1029,7 @@ For this reason, the documentation must be built only after all the other module
.. _doc-kurento CI job: https://ci.openvidu.io/jenkins/job/Development/job/kurento_doc_merged/
.. _doc-kurento: https://github.com/Kurento/doc-kurento
.. _doc-kurento-readthedocs: https://github.com/Kurento/doc-kurento-readthedocs
.. _VERSIONS.conf.sh: https://github.com/Kurento/doc-kurento/blob/e021a6c98bcea4db351faf423e90b64b8aa977f6/VERSIONS.conf.sh
.. _VERSIONS.env: https://github.com/Kurento/doc-kurento/blob/0e80f4c3aef3db6e46205ebf0075c00d2f20596b/VERSIONS.env



Expand Down
82 changes: 51 additions & 31 deletions source/knowledge/nat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,74 +219,94 @@ In order to tell one host when it has to perform an outbound transmission to ano
Do-It-Yourself hole punching
----------------------------

It is very easy to test the NAT capabilities in a local network. To do this, you need access to two hosts:
It is very easy to test the NAT capabilities in a local network. To do this, you need access to two machines:

A. One sitting behind a NAT. We'll call this the host **[A]**.
B. One outside the NAT (e.g. by directly connecting it to the internet, with no firewall). This is host **[B]**.
* One outside the NAT, e.g. by directly connecting it to the internet, with no firewall. We'll call this the **[Server]**.
* One sitting behind a NAT. This is the typical situation for consumer-grade home networks, so this one will be the **[Client]**.

Set some helper variables: the *public* IP address of each host, and their listening ports:

.. code-block:: shell
A_IP="198.51.100.1" # Public IP address of the NAT which hides the host [A]
A_PORT="1111" # Listening port on the host [A]
B_IP="203.0.113.2" # Public IP address of the host [B]
B_PORT="2222" # Listening port of the host [B]
SERVER_IP="203.0.113.2" # Public IP address of the Server
SERVER_PORT="1111" # Listening port of the Server
1. **[A]** starts listening for data. Leave this running in [A]:
CLIENT_IP="198.51.100.1" # Public IP address of the NAT that hides the Client
CLIENT_PORT="2222" # Listening port of the Client
1. **[Client]** starts listening for data. Leave this running in [Client]:

.. code-block:: shell
nc -4nul "$A_PORT"
nc -vnul "$CLIENT_PORT"
2. **[B]** tries to send data, but the NAT in front of **[A]** will discard the packets. Run in [B]:
2. **[Server]** tries to send data, but the NAT in front of **[Client]** will discard the packets. Run in [Server]:

.. code-block:: shell
echo "TEST" | nc -4nu -q 1 -p "$B_PORT" "$A_IP" "$A_PORT"
echo "TEST" | nc -vnu -p "$SERVER_PORT" "$CLIENT_IP" "$CLIENT_PORT"
3. **[Client]** performs a hole punch, forcing its NAT to create a new inbound rule. **[Server]** awaits for the UDP packet, for verification purposes.

Run in [Server]:

3. **[A]** performs a hole punch, forcing its NAT to create a new inbound rule. **[B]** awaits for the UDP packet, for verification purposes.
.. code-block:: shell
sudo tcpdump -n -i eth0 "src host $CLIENT_IP and udp dst port $SERVER_PORT"
Run in [B]:
Run in [Client]:

.. code-block:: shell
sudo tcpdump -n -i eth0 "src host $A_IP and udp dst port $B_PORT"
sudo hping3 --count 1 --udp --baseport "$CLIENT_PORT" --keep --destport "$SERVER_PORT" "$SERVER_IP"
Run in [A]:
As an alternative to *hping3*, it's also possible to use plain *netcat*:

.. code-block:: shell
sudo hping3 --count 1 --udp --baseport "$A_PORT" --keep --destport "$B_PORT" "$B_IP"
echo "TEST" | nc -vnu -p "$CLIENT_PORT" "$SERVER_IP" "$SERVER_PORT"
4. **[B]** tries to send data again. Run in [B]:
4. **[Server]** tries to send data again. Run in [Server]:

.. code-block:: shell
echo "TEST" | nc -4nu -q 1 -p "$B_PORT" "$A_IP" "$A_PORT"
echo "TEST" | nc -vnu -p "$SERVER_PORT" "$CLIENT_IP" "$CLIENT_PORT"
After this command, you should see the "TEST" string appearing on the Client.

.. note::

- The difference between a Cone NAT and a Symmetric NAT can be detected during step 3. If the *tcpdump* command on **[B]** shows a source port equal to *$A_PORT*, then the NAT is respecting the source port chosen by the application, which means that it is one of the Cone NAT types. However, if *tcpdump* shows that the source port is different from *$A_PORT*, then the NAT is changing the source port during outbound mapping, which means that it is a Symmetric NAT.
The difference between a Cone NAT and a Symmetric NAT can be detected during step 3:

- In the case of a Cone NAT, the data sent from **[B]** should arrive correctly at **[A]** after step 4.
* If the *tcpdump* command on **[Server]** shows a source port equal to *$CLIENT_PORT*, then the NAT is respecting the source port chosen by the application, which means that it is one of the Cone NAT types.

- In the case of a Symmetric NAT, the data sent from **[B]** won't arrive at **[A]** after step 4, because *$A_PORT* is the wrong destination port. If you write the correct port (as discovered in step 3) instead of *$A_PORT*, then the data should arrive at **[A]**.
In this case, the data sent from **[Server]** should arrive correctly at **[Client]** after step 4.

* However, if *tcpdump* shows that the source port is different from *$CLIENT_PORT*, then the NAT is changing the source port during outbound mapping, which means that it is a Symmetric NAT.

When this happens, the data sent from **[Server]** won't arrive at **[Client]** after step 4, because *$CLIENT_PORT* is the wrong destination port. If you write the correct port (as discovered in step 3) instead of *$CLIENT_PORT*, then the data should arrive at **[Client]**.

PySTUN
------

**PySTUN** is a tool that uses STUN servers in order to try and detect what is the type of the NAT, when run from a host behind it.

Currently it has been best updated in one of its forks, so we suggest using that instead of the version from the original creator. To install and run:
PyNAT
-----

**PyNAT** is a tool that uses STUN servers in order to try and detect what is the type of the NAT, when running from a host behind it. To install and run:

.. code-block:: shell
git clone https://github.com/konradkonrad/pystun.git pystun-konrad
cd pystun-konrad/
git checkout research
mv README.md README.rst
sudo python setup.py install
pystun
sudo apt-get update && sudo apt-get install --no-install-recommends --yes \
python3 python3-pip
sudo -H pip3 install --upgrade pynat
pynat
You will see an output similar to this:

.. code-block:: shell-session
$ pynat
Network type: Restricted-port NAT
Internal address: 192.168.1.2:54320
External address: 203.0.113.9:54320
6 changes: 3 additions & 3 deletions source/knowledge/safari.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ A video tag that includes all these suggestions would be like this:

.. code-block:: html

<video id="myVideo" playsinline autoplay muted></video>
<video id="myVideo" autoplay muted playsinline></video>

Sources for this section:

Expand Down Expand Up @@ -81,14 +81,14 @@ Most browsers assume that a video should be played from inside the specific area

.. code-block:: html

<video id="myVideo" width="480px" height="360px"></video>
<video id="myVideo" style="width: 320px"></video>

will play the video in an area that is 480x360 pixels.

That is not the case for *iOS Safari*, where all videos play full screen by default: whenever a video starts playing, the browser will maximize its area to fill all the available space in the screen. This can be avoided by adding the *playsinline* attribute to the ``<video>`` tag:

.. code-block:: html

<video id="myVideo" width="480px" height="360px" playsinline></video>
<video id="myVideo" style="width: 320px" playsinline></video>

With this, videos will play in *iOS Safari* as they do in any other browser, as inline videos inside their corresponding area.
2 changes: 1 addition & 1 deletion source/knowledge/selfsigned_certs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ This technique is very handy, because practically all modern platforms include a
* Mac and iOS include mDNS natively.
* Linux systems support mDNS if the appropriate Avahi packages are installed.

If you want to push for the addition of mDNS in Android, go ahead and `add a STAR to this issue <https://issuetracker.google.com/issues/140786115>`__ (requires login; any Google account will do).
If you want to push for the addition of mDNS in Android, go ahead and add a STAR to this issue: `#140786115 Add .local mDNS resolving to Android <https://issuetracker.google.com/140786115>`__ (requires login; any Google account will do). **Please refrain from commenting "+1"**, which is generally regarded as rude because it sends a useless email to all other users that are following the issue; adding a star is already the best way to signal interest in getting the issue resolved.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,15 +651,15 @@ <h3>Uses of <a href="../../../../org/kurento/client/Continuation.html" title="in
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">MediaPipeline.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaPipeline.html#getGstreamerDot-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/Continuation.html" title="interface in org.kurento.client">Continuation</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;cont)</code>
<td class="colLast"><span class="typeNameLabel">MediaElement.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaElement.html#getGstreamerDot-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/Continuation.html" title="interface in org.kurento.client">Continuation</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;cont)</code>
<div class="block">Asynchronous version of getGstreamerDot:
<a href="../../../../org/kurento/client/Continuation.html#onSuccess-F-"><code>onSuccess(F)</code></a> is called when the action is
done.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">MediaElement.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaElement.html#getGstreamerDot-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/Continuation.html" title="interface in org.kurento.client">Continuation</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;cont)</code>
<td class="colLast"><span class="typeNameLabel">MediaPipeline.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaPipeline.html#getGstreamerDot-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/Continuation.html" title="interface in org.kurento.client">Continuation</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;cont)</code>
<div class="block">Asynchronous version of getGstreamerDot:
<a href="../../../../org/kurento/client/Continuation.html#onSuccess-F-"><code>onSuccess(F)</code></a> is called when the action is
done.</div>
Expand All @@ -676,7 +676,7 @@ <h3>Uses of <a href="../../../../org/kurento/client/Continuation.html" title="in
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">MediaPipeline.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaPipeline.html#getGstreamerDot-org.kurento.client.GstreamerDotDetails-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/GstreamerDotDetails.html" title="enum in org.kurento.client">GstreamerDotDetails</a>&nbsp;details,
<td class="colLast"><span class="typeNameLabel">MediaElement.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaElement.html#getGstreamerDot-org.kurento.client.GstreamerDotDetails-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/GstreamerDotDetails.html" title="enum in org.kurento.client">GstreamerDotDetails</a>&nbsp;details,
<a href="../../../../org/kurento/client/Continuation.html" title="interface in org.kurento.client">Continuation</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;cont)</code>
<div class="block">Asynchronous version of getGstreamerDot:
<a href="../../../../org/kurento/client/Continuation.html#onSuccess-F-"><code>onSuccess(F)</code></a> is called when the action is
Expand All @@ -685,7 +685,7 @@ <h3>Uses of <a href="../../../../org/kurento/client/Continuation.html" title="in
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">MediaElement.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaElement.html#getGstreamerDot-org.kurento.client.GstreamerDotDetails-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/GstreamerDotDetails.html" title="enum in org.kurento.client">GstreamerDotDetails</a>&nbsp;details,
<td class="colLast"><span class="typeNameLabel">MediaPipeline.</span><code><span class="memberNameLink"><a href="../../../../org/kurento/client/MediaPipeline.html#getGstreamerDot-org.kurento.client.GstreamerDotDetails-org.kurento.client.Continuation-">getGstreamerDot</a></span>(<a href="../../../../org/kurento/client/GstreamerDotDetails.html" title="enum in org.kurento.client">GstreamerDotDetails</a>&nbsp;details,
<a href="../../../../org/kurento/client/Continuation.html" title="interface in org.kurento.client">Continuation</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;cont)</code>
<div class="block">Asynchronous version of getGstreamerDot:
<a href="../../../../org/kurento/client/Continuation.html#onSuccess-F-"><code>onSuccess(F)</code></a> is called when the action is
Expand Down

0 comments on commit 696afec

Please sign in to comment.