Giter VIP home page Giter VIP logo

sockjs-ruby's People

Contributors

majek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sockjs-ruby's Issues

Problems running sockjs-ruby example server app on 1.9.3-p125 with rack 1.4.1

Hi guys,

I've problem running simple sockjs-ruby server with rack 1.4.1 - my code

#!/usr/bin/env ruby
# encoding: utf-8

require "thin"
require "rack"
require "rack/sockjs"
require "eventmachine"

# Your custom app.
class MyHelloWorld
  def call(env)
    body = "This is the app, not SockJS."
    headers = {
      "Content-Type" => "text/plain; charset=UTF-8",
      "Content-Length" => body.bytesize.to_s
    }

    [200, headers, [body]]
  end
end


app = Rack::Builder.new do
  # Run one SockJS app on /echo.
  use SockJS, "/echo" do |connection|
    connection.subscribe do |session, message|
      session.send(message)
    end
  end

  # ... and the other one on /close.
  use SockJS, "/close" do |connection|
    connection.session_open do |session|
      session.close(3000, "Go away!")
    end
  end

  # This app will run on other URLs than /echo and /close,
  # as these has already been assigned to SockJS.
  run MyHelloWorld.new
end


EM.run do
  thin = Rack::Handler.get("thin")
  thin.run(app.to_app, Port: 8081)
end

and after trying to run I'm encountering following error

/Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:82:in `block in use': undefined method `new' for SockJS:Module (NoMethodError)
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:130:in `[]'
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:130:in `block in to_app'
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:130:in `each'
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:130:in `inject'
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:130:in `to_app'
    from server/server.rb:46:in `block in <main>'
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call'
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
    from /Users/null/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
    from server/server.rb:44:in `<main>'

How to fix that ?

Finish all the specs

There are some blank spots:

spec/sockjs/transport_spec.rb
100:      # TODO
141:      # TODO
145:      # TODO
149:      # TODO
153:      # TODO

spec/sockjs/transports/chunking_test_spec.rb
65:  # TODO: test if Transport#handler(prefix) can find it (it can't).

spec/sockjs/transports/jsonp_spec.rb
126:        # TODO: test with invalid data like d=sth, we should get Broken encoding.

spec/sockjs/transports/websocket_spec.rb
14:  # TODO: This should be a mixin.
18:    # TODO: In fact the first argument should always be the transport,
21:      # TODO: Use Connection#create_session instead of

spec/sockjs/transports/xhr_spec.rb
183:        # TODO: Come up with a better way how to test it.

Plus all the pending specs and spec/sockjs/session_spec.rb.

No live gem

I'd really like to use sockjs in a Ruby project I'm working on, but I don't see the gem. I'm loathe to push your gem for you, or to include sockjs-ruby wholesale into my project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.