
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
= rawjsonrpc
rawjsonrpc is a libary to create a jsonrpc client for every type of stream. It also profides an server and client over tcpip. This is libary is a my first try in ruby to create a gem. Its more a test how gems work but i hope i can help somebody with this lib.
== load lib
install libary
gem install rawjsonrpc
include rawjsonrpc in your programm
require 'rawjsonrpc'
== Use the TCP client
Create a client to send rpc calls.
client = RawJsonRpc::ClientSocket.new('192.168.2.10', 8080) #creates TCP client ret = client.request("func1", nil) #calles func1 with no para #returns result in ret ret = client.request("func2", 1, 3.0, :test, "om") #calles func2 with 4 paras ret = client.func3([1, 2, 3, 4]) #calles func3 with a array client.notification("noti", 1, "t") #send notifaction no return value client.close()
== Use the TCP server
Use the gserver to serve data over tcp ip
server = RawJsonRpc::JSONTCPServer.new(8080) server.add_method("func1", method("do_stuff1")) # adds do_stuff1 as "func1" server.add_method("foo", method(:bar)) # adds bar as foo server.add_block("func2"){|a,b, *c| # adds a block with 2 args #do stuff # and args as func2 } server.start server.join
== implement your own jsonclient
Boilerplate Code to create your own client.
class superclient < RawJsonRpc::RawClientJsonRpc def initiailize(*args) # init stream end
def send_request(jsonstring)
#send stream
end
def get_response
#return the response
end
def close
#close resources if needed
end
end
== implement your server
The boilerplattecode to create a new server.
class superserver include RawJsonRpc::RawServerJsonRpc
def initizial(*args)
#init
end
def serve
#get data from client
response = execute(jsonstring) #transfers the string and calls function
#return response string or nil if its a notification
#send response
end
def end
#stuff
end
end
== known issues
== Your implementations
feel free to contribute your client and servers to the project.
== TODO
== Contributing to rawjsonrpc
== Copyright
Copyright (c) 2012 Alexander Schrode. See LICENSE.txt for further details.
FAQs
Unknown package
We found that rawjsonrpc 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
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.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.