Socksify supplies an adapter for Net::HTTP. Load that adapter and use its documented socks_proxy method:

require 'socksify/http'

uri = URI('http://example.com/?view=compact')
Net::HTTP.socks_proxy('127.0.0.1', 1400)
         .start(uri.host, uri.port) do |http|
  response = http.get(uri.request_uri)
  puts response.body
end

The local port is an example SOCKS endpoint. For a permitted public-site test through an unauthenticated SOCKS service, a compatible candidate from the SOCKS proxy list can replace that host and port; match the protocol supported by the installed adapter. request_uri preserves the path and query and supplies a slash when the URL has no explicit path. Printing the response object’s inspection output is different from reading its body.

The block form closes the HTTP session when the block finishes. This example is for an HTTP destination; an HTTPS client also needs its normal TLS configuration.

Older snippets spell the factory SOCKSProxy. The project’s current implementation retains that as an alias, while its README uses socks_proxy. Check the installed Socksify and Ruby combination because the adapter integrates with Net::HTTP internals.

ХӀокхунах тера йаззамаш