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.
Webmate is a fully asynchronous real-time web application framework in Ruby. It is built using EventMachine and WebSockets. Webmate primarily designed for providing full-duplex bi-directional communication.
Webmate provides high-level api to create applications based on Websocket. Instead of separating code to http/websocket, you write one code, which may work using http or websocket (or both).
Sample:
Webmate::Application.define_routes do
resources :tasks, transport: [:http, :WS]
end
This simple route will allow you create, update, delete tasks using ONE websocket connection.
$ gem install webmate
$ webmate server
$ webmate console
$ rake routes
Gemfile
gem 'webmate'
gem 'slim'
gem 'sass'
gem 'rake'
gem 'webmate-sprockets'
gem 'webmate-client'
config.ru
require './config/environment'
if configatron.assets.compile
map '/assets' do
run Sinatra::Sprockets.environment
end
end
run Webmate::Application
config/config.rb
Webmate::Application.configure do |config|
# add directory to application load paths
#config.app.load_paths << ["app/uploaders"]
config.app.cache_classes = true
config.assets.compile = false
config.websockets.namespace = 'api'
config.websockets.enabled = true
config.websockets.port = 9020
end
Webmate::Application.configure(:development) do |config|
config.app.cache_classes = false
config.assets.compile = true
config.websockets.port = 3503
end
config/environment.rb
WEBMATE_ROOT = File.expand_path('.')
require 'webmate'
# app/routes/homepage_routes.rb
Webmate::Application.define_routes do
get '/', to: 'pages#index', transport: [:http]
end
# app/responders/base_reponder.rb
class BaseResponder < Webmate::Responders::Base
# Available options
# before_filter :do_something
rescue_from Webmate::Responders::ActionNotFound do
render_not_found
end
end
# app/responders/pages_reponder.rb
class PagesResponder < BaseResponder
include Webmate::Responders::Templates
def index
slim :index, layout: 'application'
end
end
# app/views/layouts/application.html.slim
div
== yield
# app/views/pages/index.html.slim
Hello World!
# config/mongoid.yml
development:
sessions:
default:
database: deex_example
hosts:
- localhost:27017
# config/initializers/mongoid.rb
Mongoid.load!(File.join(Webmate.root, 'config', 'mongoid.yml'))
# app/models/project.rb
class Project
include Mongoid::Document
field :name
field :description
field :status
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Licenced under MIT.
Hope, you'll enjoy Webmate!
Cheers, Droid Labs.
FAQs
Unknown package
We found that webmate 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.