Sending data to Unix socket failing unless proxied with socat via UDPHow can I communicate with a Unix domain socket via the shell on Debian Squeeze?Emulate console by sending data on one UDP port, and receive text from anotherHow does moving a unix domain socket enable socat to monitor traffic?What happens with unix stream ancillary data on partial reads?UDP Port Fowarding: channel 2: open failed: connect failed: Connection refusedHow can I repeatedly send the contents of a file via socat / ncat to a socketUnix Domain Socket with VMControling a PC via tcp/udp commands necat/socatBuilding a Unix socket bridge via TCPcreate a UDP to serial bridge with socatproblem piping data into nc

Are the number of citations and number of published articles the most important criteria for a tenure promotion?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function

What's that red-plus icon near a text?

What is the word for reserving something for yourself before others do?

Can a vampire attack twice with their claws using Multiattack?

What would happen to a modern skyscraper if it rains micro blackholes?

Codimension of non-flat locus

Character reincarnated...as a snail

Is it possible to record a short contained sound no longer than 60 milliseconds?

Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?

How to determine what difficulty is right for the game?

strTok function (thread safe, supports empty tokens, doesn't change string)

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How can I make my BBEG immortal short of making them a Lich or Vampire?

Why can't we play rap on piano?

Malcev's paper "On a class of homogeneous spaces" in English

tikz convert color string to hex value

How do I deal with an unproductive colleague in a small company?

Why do I get two different answers for this counting problem?

How do I gain back my faith in my PhD degree?

Theorems that impeded progress

Does an object always see its latest internal state irrespective of thread?

RSA: Danger of using p to create q



Sending data to Unix socket failing unless proxied with socat via UDP


How can I communicate with a Unix domain socket via the shell on Debian Squeeze?Emulate console by sending data on one UDP port, and receive text from anotherHow does moving a unix domain socket enable socat to monitor traffic?What happens with unix stream ancillary data on partial reads?UDP Port Fowarding: channel 2: open failed: connect failed: Connection refusedHow can I repeatedly send the contents of a file via socat / ncat to a socketUnix Domain Socket with VMControling a PC via tcp/udp commands necat/socatBuilding a Unix socket bridge via TCPcreate a UDP to serial bridge with socatproblem piping data into nc






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm trying to debug why data isn't being sent over a Unix Domain Socket.



I have 2 applications which should be communicating over a UDS but aren't.



To test I've done the following:



Using socat, I listen on a socket like this:



socat -x -u UNIX-RECV:/tmp/dd.sock STDOUT



and using netcat to send data like this:



echo "hello" | nc -U -w1 /tmp/dd.sock



nothing happens.



But if I also set up socat as a proxy, to listen to a UDP port, and write that to the socket like this:



socat -s -u UDP-RECV:9988 UNIX-SENDTO:/tmp/dd.sock



Then sending via netcat to the UDP port works:



echo "Hello" | nc -u localhost 9988



I've also been able to get my client application to write UDP to the proxy and it's successful where is wasn't when writing to the unix socket.



I would like to understand why socat doesn't receive data written to it by nc, but does if I proxy over UDP.



Using Amazon Linux
4.14.101-75.76.amzn1.x86_64










share|improve this question









New contributor




Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • @RuiFRibeiro . I mentioned the applications for background. My example which demonstrates the problem using socat and nc reproduces the problem. I shall update the question to make the question more clear.

    – Will
    2 days ago

















1















I'm trying to debug why data isn't being sent over a Unix Domain Socket.



I have 2 applications which should be communicating over a UDS but aren't.



To test I've done the following:



Using socat, I listen on a socket like this:



socat -x -u UNIX-RECV:/tmp/dd.sock STDOUT



and using netcat to send data like this:



echo "hello" | nc -U -w1 /tmp/dd.sock



nothing happens.



But if I also set up socat as a proxy, to listen to a UDP port, and write that to the socket like this:



socat -s -u UDP-RECV:9988 UNIX-SENDTO:/tmp/dd.sock



Then sending via netcat to the UDP port works:



echo "Hello" | nc -u localhost 9988



I've also been able to get my client application to write UDP to the proxy and it's successful where is wasn't when writing to the unix socket.



I would like to understand why socat doesn't receive data written to it by nc, but does if I proxy over UDP.



Using Amazon Linux
4.14.101-75.76.amzn1.x86_64










share|improve this question









New contributor




Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • @RuiFRibeiro . I mentioned the applications for background. My example which demonstrates the problem using socat and nc reproduces the problem. I shall update the question to make the question more clear.

    – Will
    2 days ago













1












1








1


1






I'm trying to debug why data isn't being sent over a Unix Domain Socket.



I have 2 applications which should be communicating over a UDS but aren't.



To test I've done the following:



Using socat, I listen on a socket like this:



socat -x -u UNIX-RECV:/tmp/dd.sock STDOUT



and using netcat to send data like this:



echo "hello" | nc -U -w1 /tmp/dd.sock



nothing happens.



But if I also set up socat as a proxy, to listen to a UDP port, and write that to the socket like this:



socat -s -u UDP-RECV:9988 UNIX-SENDTO:/tmp/dd.sock



Then sending via netcat to the UDP port works:



echo "Hello" | nc -u localhost 9988



I've also been able to get my client application to write UDP to the proxy and it's successful where is wasn't when writing to the unix socket.



I would like to understand why socat doesn't receive data written to it by nc, but does if I proxy over UDP.



Using Amazon Linux
4.14.101-75.76.amzn1.x86_64










share|improve this question









New contributor




Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm trying to debug why data isn't being sent over a Unix Domain Socket.



I have 2 applications which should be communicating over a UDS but aren't.



To test I've done the following:



Using socat, I listen on a socket like this:



socat -x -u UNIX-RECV:/tmp/dd.sock STDOUT



and using netcat to send data like this:



echo "hello" | nc -U -w1 /tmp/dd.sock



nothing happens.



But if I also set up socat as a proxy, to listen to a UDP port, and write that to the socket like this:



socat -s -u UDP-RECV:9988 UNIX-SENDTO:/tmp/dd.sock



Then sending via netcat to the UDP port works:



echo "Hello" | nc -u localhost 9988



I've also been able to get my client application to write UDP to the proxy and it's successful where is wasn't when writing to the unix socket.



I would like to understand why socat doesn't receive data written to it by nc, but does if I proxy over UDP.



Using Amazon Linux
4.14.101-75.76.amzn1.x86_64







socat unix-sockets nc






share|improve this question









New contributor




Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago







Will













New contributor




Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









WillWill

1084




1084




New contributor




Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Will is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • @RuiFRibeiro . I mentioned the applications for background. My example which demonstrates the problem using socat and nc reproduces the problem. I shall update the question to make the question more clear.

    – Will
    2 days ago

















  • @RuiFRibeiro . I mentioned the applications for background. My example which demonstrates the problem using socat and nc reproduces the problem. I shall update the question to make the question more clear.

    – Will
    2 days ago
















@RuiFRibeiro . I mentioned the applications for background. My example which demonstrates the problem using socat and nc reproduces the problem. I shall update the question to make the question more clear.

– Will
2 days ago





@RuiFRibeiro . I mentioned the applications for background. My example which demonstrates the problem using socat and nc reproduces the problem. I shall update the question to make the question more clear.

– Will
2 days ago










1 Answer
1






active

oldest

votes


















1














You have set up a listening datagram socket with socat+UNIX-RECV: and are attempting to talk to it via a stream socket with nc.



The second scenario works because in that case you added the missing -u flag to nc, so that both it and socat were employing a datagram socket. It wasn't anything to do with there being a proxy.



Further reading



  • https://unix.stackexchange.com/a/294221/5132





share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Will is a new contributor. Be nice, and check out our Code of Conduct.









    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510282%2fsending-data-to-unix-socket-failing-unless-proxied-with-socat-via-udp%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You have set up a listening datagram socket with socat+UNIX-RECV: and are attempting to talk to it via a stream socket with nc.



    The second scenario works because in that case you added the missing -u flag to nc, so that both it and socat were employing a datagram socket. It wasn't anything to do with there being a proxy.



    Further reading



    • https://unix.stackexchange.com/a/294221/5132





    share|improve this answer



























      1














      You have set up a listening datagram socket with socat+UNIX-RECV: and are attempting to talk to it via a stream socket with nc.



      The second scenario works because in that case you added the missing -u flag to nc, so that both it and socat were employing a datagram socket. It wasn't anything to do with there being a proxy.



      Further reading



      • https://unix.stackexchange.com/a/294221/5132





      share|improve this answer

























        1












        1








        1







        You have set up a listening datagram socket with socat+UNIX-RECV: and are attempting to talk to it via a stream socket with nc.



        The second scenario works because in that case you added the missing -u flag to nc, so that both it and socat were employing a datagram socket. It wasn't anything to do with there being a proxy.



        Further reading



        • https://unix.stackexchange.com/a/294221/5132





        share|improve this answer













        You have set up a listening datagram socket with socat+UNIX-RECV: and are attempting to talk to it via a stream socket with nc.



        The second scenario works because in that case you added the missing -u flag to nc, so that both it and socat were employing a datagram socket. It wasn't anything to do with there being a proxy.



        Further reading



        • https://unix.stackexchange.com/a/294221/5132






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        JdeBPJdeBP

        37.8k478182




        37.8k478182




















            Will is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            Will is a new contributor. Be nice, and check out our Code of Conduct.












            Will is a new contributor. Be nice, and check out our Code of Conduct.











            Will is a new contributor. Be nice, and check out our Code of Conduct.














            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510282%2fsending-data-to-unix-socket-failing-unless-proxied-with-socat-via-udp%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

            NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided