<html><head></head><body>They're blocked by Chromium and Safari AFAIK.<br><br><div class="gmail_quote">Le 16 août 2019 13:08:22 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Hello,<br><br>On Tue, Aug 13, 2019, at 18:53, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">vlc | branch: master | Rémi Denis-Courmont <remi@remlab.net> | Tue Aug <br>13 19:45:14 2019 +0300| [2b00ed2e226133ce5521ce6e5cafcf4546fa4bd2] | <br>committer: Rémi Denis-Courmont<br><br>http: block special ports<br><br>This follows the defacto standard list of blocked ports for web<br>browsing (see also "Mozilla Port Blocking").<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2b00ed2e226133ce5521ce6e5cafcf4546fa4bd2">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2b00ed2e226133ce5521ce6e5cafcf4546fa4bd2</a><br></blockquote><hr> modules/access/http/Makefile.am |   1 +<br> modules/access/http/connmgr.c   |   3 ++<br> modules/access/http/ports.c     | 113 ++++++++++++++++++++++++++++++++++++++++<br> modules/access/http/transport.h |   2 +<br> 4 files changed, 119 insertions(+)<br><br>diff --git a/modules/access/http/Makefile.am <br>b/modules/access/http/Makefile.am<br>index eea267f6e8..8054457b6c 100644<br>--- a/modules/access/http/Makefile.am<br>+++ b/modules/access/http/Makefile.am<br>@@ -12,6 +12,7 @@ libvlc_http_la_SOURCES = \<br>       access/http/h2frame.c access/http/h2frame.h \<br>         access/http/h2output.c access/http/h2output.h \<br>       access/http/h2conn.c access/http/h1conn.c \<br>+  access/http/ports.c \<br>         access/http/chunked.c access/http/tunnel.c access/http/conn.h \<br>       access/http/connmgr.c access/http/connmgr.h<br> libvlc_http_la_CPPFLAGS = -Dneedsomethinghere<br>diff --git a/modules/access/http/connmgr.c <br>b/modules/access/http/connmgr.c<br>index 43326b5252..f0f7616e40 100644<br>--- a/modules/access/http/connmgr.c<br>+++ b/modules/access/http/connmgr.c<br>@@ -260,6 +260,9 @@ struct vlc_http_msg *vlc_http_mgr_request(struct <br>vlc_http_mgr *mgr, bool https,<br>                                           const char *host, unsigned <br>port,<br>                                           const struct vlc_http_msg *m)<br> {<br>+    if (port && vlc_http_port_blocked(port))<br>+        return NULL;<br>+<br>     return (https ? vlc_https_request : vlc_http_request)(mgr, host, <br>port, m);<br> }<br> <br>diff --git a/modules/access/http/ports.c b/modules/access/http/ports.c<br>new file mode 100644<br>index 0000000000..66ac89b621<br>--- /dev/null<br>+++ b/modules/access/http/ports.c<br>@@ -0,0 +1,113 @@<br>+/*****************************************************************************<br>+ * ports.c: special ports block list<br>+ *****************************************************************************<br>+ * Copyright © 2019 Rémi Denis-Courmont<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify it<br>+ * under the terms of the GNU Lesser General Public License as published by<br>+ * the Free Software Foundation; either version 2.1 of the License, or<br>+ * (at your option) any later version.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU Lesser General Public License for more details.<br>+ *<br>+ * You should have received a copy of the GNU Lesser General Public License<br>+ * along with this program; if not, write to the Free Software Foundation,<br>+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.<br>+ *****************************************************************************/<br>+<br>+#ifdef HAVE_CONFIG_H<br>+# include <config.h><br>+#endif<br>+<br>+#include <stdbool.h><br>+#include <stdlib.h><br>+#include "transport.h"<br>+#include <vlc_common.h><br>+<br>+/* Must be in ascending order */<br>+static const unsigned short blocked_ports[] = {<br>+        1, // tcpmux<br>+        7, // echo<br>+        9, // discard<br>+       11, // systat<br>+       13, // daytime<br>+       15, // netstat<br>+       17, // QOTD<br>+       19, // character generator<br>+       20, // FTP data<br>+       21, // FTP access<br>+       22, // SSH<br>+       23, // Telnet<br>+       25, // SMTP<br>+       37, // time<br>+       42, // name<br>+       43, // nicname<br>+       53, // DNS<br>+       77, // priv-rjs<br>+       79, // finger<br>+       87, // ttylink<br>+       95, // supdup<br>+      101, // hostriame<br>+      102, // iso-tsap<br>+      103, // gppitnp<br>+      104, // acr-nema<br>+      109, // POP2<br>+      110, // POP3<br>+      111, // Sun RPC<br>+      113, // auth<br>+      115, // SFTP<br>+      117, // UUCP path service<br>+      119, // NNTP (i.e. Usenet)<br>+      123, // NTP<br>+      135, // DCE endpoint resolution<br>+      139, // NetBIOS<br>+      143, // IMAP2<br>+      179, // BGP<br>+      389, // LDAP<br>+      465, // SMTP/TLS<br>+      512, // remote exec<br>+      513, // remote login<br>+      514, // remote shell<br>+      515, // printer<br>+      526, // tempo<br>+      530, // courier<br>+      531, // chat<br>+      532, // netnews<br>+      540, // UUCP<br>+      556, // remotefs<br>+      563, // NNTP/TLS<br>+      587, // Submission (i.e. first hop SMTP)<br>+      601, // rsyslog<br>+      636, // LDAP/TLS<br>+      993, // LDAP/TLS<br>+      995, // POP3/TLS<br>+     2049, // NFS<br>+     3659, // Apple SASL<br>+     4045, // NFS RPC lockd<br>+     6000, // X11<br>+     6665, // IRC<br>+     6666, // IRC<br>+     6667, // IRC<br>+     6668, // IRC<br>+     6669, // IRC<br></blockquote><br>cf. <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Mozilla_Port_Blocking">https://developer.mozilla.org/en-US/docs/Mozilla/Mozilla_Port_Blocking</a><br><br>3659, 6665-6669 are not blocked by mozilla. Why are you blocking it ?<br><br>Such commit could have been proposed on the mailing list first...<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> +};<br> +<br> +static int portcmp(const void *key, const void *entry)<br> +{<br> +    const unsigned *port = key;<br> +    const unsigned short *blocked_port = entry;<br> +<br> +    return ((int)*port) - ((int)*blocked_port);<br> +}<br> +<br> +bool vlc_http_port_blocked(unsigned port)<br> +{<br> +    if (port > 0xffff)<br> +        return true;<br> +<br> +    return bsearch(&port, blocked_ports, ARRAY_SIZE(blocked_ports),<br> +                   sizeof (unsigned short), portcmp) != NULL;<br> +}<br> diff --git a/modules/access/http/transport.h b/modules/access/http/transport.h<br> index 455f424931..3a7806c1ed 100644<br> --- a/modules/access/http/transport.h<br> +++ b/modules/access/http/transport.h<br> @@ -34,4 +34,6 @@ struct vlc_tls *vlc_https_connect_proxy(void *ctx,<br>                                          struct vlc_tls_client *creds,<br>                                          const char *name, unsigned port,<br>                                          bool *restrict two, const char *proxy);<br> +bool vlc_http_port_blocked(unsigned port);<br> +<br>  #endif<hr> vlc-commits mailing list<br> vlc-commits@videolan.org<br> <a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>