What do you mean by "the sandbox"?
Do you just mean the Xcode sandbox feature or are you talking about a Mac App Store app? The difference is very important.
Since this path is outside the sandbox, obviously your app (and its child task curl) can't access it. That's the whole point of the sandbox. If this is some purpose-built, quick-n-dirty app, you could probably just give yourself a temporary sandbox exemption. Or just turn off the sandbox.
If this is a Mac App Store app and/or you want to do it the "proper" way, then you'll need a user interface to allow the user to select the socket.
PS: You might also consider ditching curl entirely and just making the connection yourself.
Topic:
Privacy & Security
SubTopic:
General
Tags: