Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
msgpack-rpc-over-http
Advanced tools
This library provides MessagePack-RPC via HTTP as XML-RPC. The original MessagePack-RPC Server in Ruby is not good in some cases. It doesn't scale. It's incompatible with Thread. There is no decent termination processing...
We alreadly have various high perfomance HTTP servers. We can use these in MessagePack-RPC over HTTP.
CAUTION
There is no compatibility with other implementation of normal MessagePack-RPC (not over HTTP). So a normal RPC client can not connect a HTTP server.
Server
confir.ru:
require 'msgpack-rpc-over-http'
class MyHandler
def add(x,y) return x+y end
end
run MessagePack::RPCOverHTTP::Server.app(MyHandler.new)
rackup:
% rackup config.ru -s thin
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9292, CTRL+C to stop
Client
client.rb:
require 'msgpack-rpc-over-http'
c = MessagePack::RPCOverHTTP::Client.new("http://0.0.0.0:9292/")
result = c.call(:add, 1, 2) #=> 3
Support streaming response via Chunked Transfer-Encoding.
# server side
class Handler
include MessagePack::RPCOverHTTP::Server::Streamer
def log
return stream do
File.open('/var/log/syslog') do |f|
while line = f.gets.chomp
# write a chunked data
chunk(line)
end
end
end
end
end
# client
client = MessagePack::RPCOverHTTP::Client.new("http://0.0.0.0:80/")
client.stream do |line|
p line # => "Nov 3 ..."
end
Add this line to your application's Gemfile:
gem 'msgpack-rpc-over-http'
And then execute:
$ bundle
Or install it yourself as:
$ gem install msgpack-rpc-over-http
TODO: Write usage instructions here
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that msgpack-rpc-over-http 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.