GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support Unix domain sockets in Netty backend · Issue #12703 · playframework/playframework

Support Unix domain sockets in Netty backend #12703

New issue
Copy link
New issue
Copy link
Open
#13222
Open
Support Unix domain sockets in Netty backend#12703
#13222
Copy link

Description

@mkurz
mkurz
opened on Jun 5, 2024
Issue body actions

Starting with Netty 4.1.110.Final and JDK 16+ (We will have 17 as base then)

  • https://netty.io/news/2024/05/22/4-1-110-Final.html
  • Add unix domain socket transport in netty 4.x via JDK16+ netty/netty#13965
  • Leverage improvements in openjdk 16 netty/netty#10991
  • https://openjdk.org/jeps/380
  • See what they did: NIO domain socket support micronaut-projects/micronaut-core#10852
Reacted by Sergey Morgunov

Activity

  1. mkurz
    added this to the 2.10.0 / 3.1.0 milestone on Jun 5, 2024
  2. mkurz
    added this to Play 4.0 (due November 2026)on Jun 5, 2024
  3. github-project-automation
    moved this to 🆕 New in Play 4.0 (due November 2026)on Jun 5, 2024
  4. mkurz
    removed this from the 5.0 milestone on Mar 17, 2025
  5. mkurz
    moved this from 🆕 New to 🏗 In Progress in Play 4.0 (due November 2026)on Mar 26, 2025
  6. mkurz
    changed the title [-](Review) Support Unix domain socket for Netty out of the box[/-] [+]Support Unix domain socket for Netty[/+] on Mar 27, 2025
  7. mkurz
    changed the title [-]Support Unix domain socket for Netty[/-] [+]Support Unix domain sockets for Netty[/+] on Mar 27, 2025
  8. mkurz
    changed the title [-]Support Unix domain sockets for Netty[/-] [+]Support Unix domain sockets in Netty backend[/+] on Mar 27, 2025
  9. mkurz commented on Mar 27, 2025

    @mkurz
    mkurz
    on Mar 27, 2025
    MemberAuthor
    More actions

    I am postponing this, as I think this not very important right now and should not block us for next release.

    Just to summarize what this issue is about:
    By default, Play listens to an address + port, like http://localhost:9000
    Java 16+ now supports Unix-Domain Socket, so what Netty implemented is that Netty does listen not on a address/port via TCP, but can create a socket instead and use that for http communication (And btw. Windows 10+ also supports such sockets now). A socket is just a file (like everything in Unix they say ;).
    And the news in Netty 4.1.110 is that this was implemented as part of the Java NIO transport (when not using the native or io_uring transport). To be honest I was a bit confused when I first read the release notes, because I thought this is somehow a replacement for the native transports (actually the native transport do support Unix Domain Sockets already, so now the NIO transports just catches up).

    Communcating via a socket instead of going throught the TCP stack should improve performance and is not limited, since you can create many sockets, but ports are limited. Also, you can manage the sockets with normal file and owner permssions since it's just a file. Also, I read that "reverse proxy setups commonly make use of unix sockets, to avoid wasting TCP ports and for lower resource use/better performance" (could not say it better ;) So... e.g. nginx provides a ngx_http_upstream_module, which allows nginx to communicate with a backend via a socket, while listening to a address/port to the outside world. Actually it would be nice if Play could support that... Here are examples also for it:

    • https://dev.to/vearutop/using-nginx-as-a-proxy-to-multiple-unix-sockets-3c7a
    • https://til.simonwillison.net/nginx/proxy-domain-sockets

    Just to note, you can use curl to communicate with a socket that talks http: curl -v --unix-socket /path/to/socket http://myurl/some/path.
    Firefox and Chromium do not support that:

    • https://bugzilla.mozilla.org/show_bug.cgi?id=1688774
    • https://issues.chromium.org/issues/40402523

    Also there is an ongoing discussion (even if it's closed) about naming scheme (did not read all of that yet ;):

    • Addressing HTTP servers over Unix domain sockets whatwg/url#577

    Stopping now, I guess its understandable what this is about. I started to stupidly play around in

    • Make use of Unix Domain Sockets in Netty (using the NIO transport) #13222
    Reacted by Sergey Morgunov
  10. mkurz
    moved this from 🏗 In Progress to 🆕 New in Play 4.0 (due November 2026)on Mar 27, 2025
  11. mkurz
    removed this from Play 4.0 (due November 2026)on Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.