# See the License for the specific language governing permissions and
# limitations under the License.
-# Data transfer with URL syntax
+# Data transfer powered by the native curl library
#
# Download or upload over HTTP with `CurlHTTPRequest` and send emails with `CurlMail`.
module curl
# Set the user agent for all following HTTP requests
var user_agent: nullable String is writable
+ # Set the Unix domain socket path to use
+ #
+ # When not null, enables using a Unix domain socket
+ # instead of a TCP connection and DNS hostname resolution.
+ var unix_socket_path: nullable String is writable
+
# Execute HTTP request
#
# By default, the response body is returned in an instance of `CurlResponse`.
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
end
+ var unix_socket_path = unix_socket_path
+ if unix_socket_path != null then
+ err = self.curl.native.easy_setopt(new CURLOption.unix_socket_path, unix_socket_path)
+ if not err.is_ok then return answer_failure(err.to_i, err.to_s)
+ end
+
# Callbacks
err = self.curl.native.register_callback_header(callback_receiver)
if not err.is_ok then return answer_failure(err.to_i, err.to_s)
# new `{ return CURLOPT_SSH_KEYFUNCTION; `}
# new `{ return CURLOPT_SSH_KEYDATA; `}
+ # TELNET Options
+
+# new `{ return CURLOPT_TELNETOPTIONS; `}
+
# Other Options
# new `{ return CURLOPT_PRIVATE; `}
# new `{ return CURLOPT_NEW_FILE_PERMS; `}
# new `{ return CURLOPT_NEW_DIRECTORY_PERMS; `}
- # TELNET Options
-
-# new `{ return CURLOPT_TELNETOPTIONS; `}
+ # Set the Unix domain socket
+ new unix_socket_path `{ return CURLOPT_UNIX_SOCKET_PATH; `}
end