From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.devel Subject: Re: (web server) serving on both ipv6 and ipv4? Date: Wed, 19 Jan 2022 09:51:07 +0100 Message-ID: <3bbd5a2c267f9e58657b0087e26c92ed36d1b81b.camel@telenet.be> References: <87k0ewi0w2.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-YdB77M7V0Z0HtDDpFQeC" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30223"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.38.3-1 To: "Dr. Arne Babenhauserheide" , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jan 19 10:34:08 2022 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nA7Lz-0007bm-Di for guile-devel@m.gmane-mx.org; Wed, 19 Jan 2022 10:34:07 +0100 Original-Received: from localhost ([::1]:45526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nA7Lx-0002Ec-V9 for guile-devel@m.gmane-mx.org; Wed, 19 Jan 2022 04:34:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nA6gk-0006xP-9r for guile-devel@gnu.org; Wed, 19 Jan 2022 03:51:30 -0500 Original-Received: from [2a02:1800:120:4::f00:14] (port=43484 helo=xavier.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nA6gZ-0003bk-9c for guile-devel@gnu.org; Wed, 19 Jan 2022 03:51:21 -0500 Original-Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by xavier.telenet-ops.be with bizsmtp id kYrC2600D4UW6Th01YrCQ7; Wed, 19 Jan 2022 09:51:12 +0100 In-Reply-To: <87k0ewi0w2.fsf@web.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1642582272; bh=ODoY/PCCigZN539N8H5BKDMFlfIePX2HoR0W1ugeGtE=; h=Subject:From:To:Date:In-Reply-To:References; b=V+eWKGRaaKqSvSjw8f+pionkjz/YbbHe1NGB1OmFuNy53ahscaq/ezPHLN6KRwRjj 8+5ElHt9tPgTHfbPH2UOQItq7acvKvo/KEmb4kQwtyJNv2DN2PhugmZhRmwzuxqjYq AK3Z03c82VQHxAvHTta7GyLFBwN0U3RYrpsl0Ti6fT09OfeZols2JroynIxRkyXwdX K8VAmsWM/DYppfLxpw2Vx1+f0HQz9eKuDoA6dYxkBClVGRZfbA3pXuOyb9I1aKarWa rETCyjiToDk0WaoNA5LfwqYnu/mACc6cttpxF20ndRjs8ryoY7hxySPq259ic+BQ4Z adetp167TPKog== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:120:4::f00:14 (failed) Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21033 Archived-At: --=-YdB77M7V0Z0HtDDpFQeC Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dr. Arne Babenhauserheide schreef op wo 19-01-2022 om 08:57 [+0100]: > Hi, >=20 >=20 > with both fibers server and (web server) there is a split between IPv4 > and IPv6: >=20 >=20 > IPv4: >=20 > =C2=A0=C2=A0=C2=A0=C2=A0(fibers:run-server handler-with-path #:family AF_= INET #:port port #:addr INADDR_ANY) >=20 > =C2=A0=C2=A0=C2=A0=C2=A0(run-server handler-with-path 'http `(#:host "loc= alhost" #:family ,AF_INET #:addr ,INADDR_ANY #:port ,port)) >=20 >=20 > IPv6: >=20 > =C2=A0=C2=A0=C2=A0=C2=A0(define s > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(let ((s (socket AF_INET6= SOCK_STREAM 0))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(= setsockopt s SOL_SOCKET SO_REUSEADDR 1) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(= bind s AF_INET6 (inet-pton AF_INET6 ip) port) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0s= )) > =C2=A0=C2=A0=C2=A0=C2=A0(fibers:run-server handler-with-path #:family AF_= INET6 #:port port #:addr (inet-pton AF_INET6 ip) #:socket s) >=20 > =C2=A0=C2=A0=C2=A0=C2=A0(define s > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(let ((s (socket AF_INET6= SOCK_STREAM 0))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(= setsockopt s SOL_SOCKET SO_REUSEADDR 1) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(= bind s AF_INET6 (inet-pton AF_INET6 ip) port) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0s= )) > =C2=A0=C2=A0=C2=A0=C2=A0(run-server handler-with-path 'http `(#:family ,A= F_INET6 #:addr (inet-pton AF_INET6 ip) #:port ,port #:socket ,s)) >=20 >=20 > Is there a way to bind to both IPv6 and IPv4, so my server will react to > requests regardless of whether a client reaches my computer over IPv4 or > IPv6? Maybe the IPV6_V6ONLY (see the ipv6(7) man page) is relevant here. Alternatively, you could run two servers in parallel: one bound to an IPv4 address and another bound to an IPv6 address. Unfortunately, the fibers HTTP server calls 'run-fibers' (even if there's already some scheduler), so each server will be run in its own fresh scheduler, this might cause problems.. There's some code in 'cuirass' and 'gnunet-scheme' (see ) that doesn't spawn its own scheduler. Greetings, Maxime. --=-YdB77M7V0Z0HtDDpFQeC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYefQ+xccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jZlAP9JRaGcBXgAJFpU26xAwKmrKCNQ oJOUYBC6gICtmDMvPgEAlojMb2NEjUASTWkTOZ7/4frvMpK2+r8MYBt2ffxd/wI= =XVaZ -----END PGP SIGNATURE----- --=-YdB77M7V0Z0HtDDpFQeC--