![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
WebSocket component for Sinatra RocketIO
% gem install sinatra-websocketio
Server Side
require 'sinatra'
require 'sinatra/websocketio'
set :websocketio, :port => 9000
run Sinatra::Application
io = Sinatra::WebSocketIO
io.push :temperature, 35 # to all clients
io.push :light, {:value => 150}, {:to => session_id} # to specific client
Client Side
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="<%= websocketio_js %>"></script>
var io = new WebSocketIO().connect();
io.on("temperature", function(value){
console.log("server temperature : " + value);
}); // => "server temperature : 35"
io.on("light", function(data){
console.log("server light sensor : " + data.value);
}); // => "server light sensor : 150"
Client Side
io.on("connect", function{
io.push("chat", {name: "shokai", message: "hello"}); // client -> server
});
Server Side
io.on :chat do |data, session|
puts "#{data['name']} : #{data['message']} <#{session}>"
end
## => "shokai : hello <12abcde345f6g7h8ijk>"
Client Side
io.on("connect", function(session){
alert("connect!!");
});
io.on("disconnect", function(){
alert("disconnected");
});
Server Side
io.on :connect do |session|
puts "new client <#{session}>"
io.push :hello, "hello!!"
end
io.on :disconnect do |session|
puts "client disconnected <#{session}>"
end
Client Side
io.on("error", function(err){
console.error(err);
});
Server Side
io.on :error do |e|
STDERR.puts e
end
Server Side
event_id = io.on :chat do |data, from|
puts "#{data} - from#{from}"
end
io.removeListener event_id
or
io.removeListener :chat # remove all "chat" listener
Client Side
var event_id = io.on("error", function(err){
console.error("WebSocketIO error : "err);
});
io.removeListener(event_id);
or
io.removeListener("error"); // remove all "error" listener
set :websocketio, :port => 9000
or
% WS_PORT=9000 rackup config.ru
chat app
% gem install bundler
% bundle install
start server
% rake test_server
run test
% rake test
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that sinatra-websocketio 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.