Skip to content
New issue

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

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

Already on GitHub? # to your account

Browser support #6

Closed
wants to merge 7 commits into from
Closed

Conversation

AnanthVivekanand
Copy link
Contributor

This PR adds browser support to this module through browserify.

Screenshot_2019-07-23_19-55-23

@AnanthVivekanand
Copy link
Contributor Author

The polyfill for the net module is located under browser/polyfills/net as a git submodule. It requires a TCP/Websocket proxy to work.

@arnabk
Copy link
Owner

arnabk commented Aug 17, 2019

Modern browsers support WS by default. We would use es6-polyfill (rather than entire babel set of libraries), but I would not worry too much about older browser and just not add any polyfills. Those who deal with crypto wont be using an old browser.

The original intension of this library was for nodeJS env and not for browsers. Please read the original statement in the readme file of this library A NodeJS based stratum client for communication with stratum-capable pool.

My understanding is, with this PR, you are trying to send information to a proxy server which will then forward it to the real stratum server. The communication between browser and proxy is not a crypto communication standard. This entire library was built on stratum+tcp:// which is a defined way of communication between client and server for cryptos.

If you still think that what you are trying to build is useful and others would use it in their browser, I recommend creating a new library with client specific code.

@arnabk arnabk closed this Aug 17, 2019
@AnanthVivekanand
Copy link
Contributor Author

I would just like to clarify a bit. The polyfill I added was not to support older browsers but instead to allow browserification of the net module. The nodejs net module can't be browserified, so I created an alternate module that transmits data over WSs. That's what I refer to by "polyfill."

The communication between the proxy server and the browser client is not a crypto communication standard. However, websockets can be used to package that information. All TCP info is being directly forwarded through a websocket. This is required because the browser can't use TCP sockets.

However, thank you for your response.

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

Successfully merging this pull request may close these issues.

2 participants