
Security News
Nx npm Packages Compromised in Supply Chain Attack Leveraging AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
= em-resolv-replace
EventMachine-aware DNS lookup for Ruby.
Ruby's stock DNS resolution, by default, blocks the entire Ruby VM from processing while the lookup is happening, because it calls out to the native libc resolver code. A slow DNS server can cause your entire Ruby process to grind to a halt. Ruby comes with a pure Ruby replacement that is not loaded by default:
require 'resolv'
require 'resolv-replace'
'resolv' is the pure Ruby DNS resolver. 'resolv-replace' monkeypatches the various Ruby Socket objects to use resolv. This gem monkeypatches the monkeypatch so that the Socket classes will use an EventMachine-aware resolver, em-dns-resolver.
== Requirements
em-resolv-replace requires Ruby 1.9.
== Installation
gem install em-resolv-replace
== Usage
Just require em-resolv-replace when initializing your application:
require 'em-resolv-replace'
The code will use the EM-aware resolver if EventMachine is running.
== Credits
em-dns-resolver.rb is taken from the em-dns project, with a connection bugfix applied by myself, and was written by Aman Gupta and Stephan Maka.
== Author
Mike Perham, @mperham, mperham AT gmail.com, http://github.com/mperham
FAQs
Unknown package
We found that em-resolv-replace demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.