Giter Club home page Giter Club logo

ruby_wamp_client's People

Contributors

ericchapman 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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

neocoin thestu

ruby_wamp_client's Issues

Poloniex wamp error on connect

connect
TX: HELLO > [1, "ticker", {:roles=>{:caller=>{:features=>{:caller_identification=>true, :call_timeout=>true, :call_canceling=>true, :progressive_call_results=>true}}, :callee=>{:features=>{:caller_identification=>true, :pattern_based_registration=>true, :shared_registration=>true, :call_canceling=>true, :progressive_call_results=>true, :registration_revocation=>true}}, :publisher=>{:features=>{:publisher_identification=>true, :subscriber_blackwhite_listing=>true, :publisher_exclusion=>true}}, :subscriber=>{:features=>{:publisher_identification=>true, :pattern_based_subscription=>true, :subscription_revocation=>true}}}, :agent=>"Ruby-WampClient-0.0.7"}]
RX: ABORT > [3, {:message=>"internal error: realm auto-activation not yet implemented"}, "wamp.error.not_authorized"]
Attempting Reconnect... Next attempt in 8 seconds

https://poloniex.com/support/api/

Empty args will omit kwargs on some message types

The code for additional fields is skipping kwargs if args is 'nil' or 'empty'. See below

        return payload if (self.arguments.nil? or self.arguments.empty?)
        payload.push(self.arguments)

        return payload if (self.argumentskw.nil? or self.argumentskw.empty?)
        payload.push(self.argumentskw)

JRuby support

I've noticed that nothing happens on a connection.open call when jruby is being used. Is there any reason why jruby isn't supported?

Using wamp_client gem in rails

Hi Eric,

I was trying to integrate this gem into my rails app, the gem works fine indepently but when i load rails environemnt along with the script, i get disconnected just after connecting and verbose:true also dosen't print logs.

Script that works:

require 'wamp_client'

wsuri = 'wss://api.poloniex.com'
options = {
    uri: wsuri,
    realm: 'realm1',
}
connection = WampClient::Connection.new(options)

connection.on_connect do
  puts 'connection established'
end

connection.on_join do |session, details|
  puts 'session created'

  def got_ticker(args, kwargs, details)
    puts args
    puts kwargs
    puts details
  end

  session.subscribe('ticker', method(:got_ticker))
end


connection.open

Rake task that does not work:

task :poloniex => :environment do
  wsuri = 'wss://api.poloniex.com'
  options = {
      uri: wsuri,
      realm: 'realm1',
      verbose: true
  }
  connection = WampClient::Connection.new(options)

  connection.on_connect do
    puts 'connection established'
  end
  connection.on_join do |session, details|
    puts 'session created'

    def got_ticker(args, kwargs, details)
      puts args
      puts kwargs
      puts details
    end

    session.subscribe('ticker', method(:got_ticker))
  end

  connection.open
end

I tried loading the environment manually as well, which also dosen't work:

require File.expand_path('../../config/environment', __FILE__)


require 'wamp_client'

wsuri = 'wss://api.poloniex.com'
options = {
    uri: wsuri,
    realm: 'realm1',
}
connection = WampClient::Connection.new(options)

connection.on_connect do
  puts 'connection established'
end

connection.on_join do |session, details|
  puts 'session created'

  def got_ticker(args, kwargs, details)
    puts args
    puts kwargs
    puts details
  end

  session.subscribe('ticker', method(:got_ticker))
end


connection.open

Output that i get from the scripts that do not work:

connection established
Attempting Reconnect... Next attempt in 2 seconds
connection established
Attempting Reconnect... Next attempt in 4 seconds
``

connecting to secured socket

require 'wamp_client'

wsuri = 'wss://api2.poloniex.com:443/'
  options = {
      uri: wsuri,
      realm: 'realm1',
      headers: {Upgrade: 'websocket',
                Connection: 'Upgrade',}
  }
  connection = WampClient::Connection.new(options)

  connection.on_connect do
    puts 'connection established'
  end

  connection.on_challenge do |authmethod, extra|
    puts 'challenged'
  end

  connection.on_disconnect do |reason|
    puts 'disconnected'
  end

  connection.on_leave do |reason, details|
    puts 'session terminted'
  end

  connection.on_join do |session, details|
    puts 'session created'

    def got_ticker(args, kwargs, details)
      puts args
      puts kwargs
      puts details
    end

    session.subscribe('ticker', method(:got_ticker))
  end

connection.open

I am trying to connect to a secured socket using this library, it gets connected, but the session never gets made(on_join is never called), the api seems to be working fine with autobahn javascript.

Ruby 2.4.0

ERROR: Error installing wamp_client:
ERROR: Failed to build gem native extension.

current directory: /home/kiju/.gem/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator

/usr/bin/ruby24 -r ./siteconf20161228-16135-vibso9.rb extconf.rb
creating Makefile

current directory: /home/kiju/.gem/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /home/kiju/.gem/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
} else if (klass == rb_cFixnum) {
^
generator.c:861:25: note: each undeclared identifier is reported only once for each function it appears in
generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
} else if (klass == rb_cBignum) {
^
Makefile:241: polecenia dla obiektu 'generator.o' nie powiodły się
make: *** [generator.o] Błąd 1

make failed, exit code 2

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.