Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wss client support #181

Closed
wants to merge 12 commits into from
Closed

add wss client support #181

wants to merge 12 commits into from

Conversation

adam429
Copy link

@adam429 adam429 commented Jan 28, 2022

Add wss client support for ethereum.rb

Support node via wss connection "wss://xxxx"

Using the pipeline of wscat.

@q9f
Copy link
Contributor

q9f commented Jan 28, 2022

Hi @adam429 - I'd be happy to accept this contribution to the new eth gem at https://github.com/q9f/eth.rb

@@ -28,6 +28,7 @@ def initialize(log = false)
def self.create(host_or_ipcpath, log = false)
return IpcClient.new(host_or_ipcpath, log) if host_or_ipcpath.end_with? '.ipc'
return HttpClient.new(host_or_ipcpath, log) if host_or_ipcpath.start_with? 'http'
return WssClient.new(host_or_ipcpath, log) if host_or_ipcpath.start_with? 'wss'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should also support insecure websockets.

Suggested change
return WssClient.new(host_or_ipcpath, log) if host_or_ipcpath.start_with? 'wss'
return WsClient.new(host_or_ipcpath, log) if host_or_ipcpath.start_with? 'ws'


module Ethereum
class WssConnection
attr_accessor :host,:ws_in,:ws_out,:ws_err,:wait_thr,:index
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also should have an ssl attribute.

Suggested change
attr_accessor :host,:ws_in,:ws_out,:ws_err,:wait_thr,:index
attr_accessor :host, :ws_in, :ws_out, :ws_err, :wait_thr, :ssl, :index

@kurotaky
Copy link
Collaborator

@adam429
Thanks for the PR. Please migrate as we will maintain the eth.rb library here. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants