Technology moves fast! ⚡ Don't get left behind.🚶 Subscribe to our mailing list to keep up with latest and greatest in open source projects! 🏆


Subscribe to our mailing list

chrome-net

Use the Node `net` API in Chrome Apps

Subscribe to updates I use chrome-net


Statistics on chrome-net

Number of watchers on Github 95
Number of open issues 2
Average time to close an issue about 1 month
Main language JavaScript
Average time to merge a PR 2 days
Open pull requests 1+
Closed pull requests 2+
Last commit over 1 year ago
Repo Created over 5 years ago
Repo Last Updated over 1 year ago
Size 184 KB
Organization / Authorfeross
Contributors8
Page Updated
Do you use chrome-net? Leave a review!
View open issues (2)
View chrome-net activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating chrome-net for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

chrome-net npm downloads javascript style guide

Use the Node net API in Chrome Apps

This module lets you use the Node.js net (TCP) API in Chrome Packaged Apps.

Instead of learning the quirks of Chrome's chrome.sockets API for networking in Chrome Apps just use the higher-level node API you're familiar with. Then, compile your code with browserify and you're all set!

install

npm install chrome-net

methods

Use node's net API, including all parameter list shorthands and variations.

Example TCP client:

var net = require('chrome-net')

var client = net.createConnection({
  port: 1337,
  host: '127.0.0.1'
})

client.write('beep')

client.on('data', function (data) {
  console.log(data)
})

// .pipe() streaming API works too!

Example TCP server:

var net = require('chrome-net')

var server = net.createServer()

server.on('listening', function () {
  console.log('listening')
})

server.on('connection', function (sock) {
  console.log('Connection from ' + sock.remoteAddress + ':' + sock.remotePort)
  sock.on('data', function (data) {
    console.log(data)
  })
})

server.listen(1337)

See nodejs.org for full API documentation: net

contribute

To run tests, use npm test. The tests will run TCP and UDP servers and launch a few different Chrome Packaged Apps with browserified client code. The tests currently require Chrome on Windows or Chrome Canary on Mac. If you're on Linux, feel free to send a pull request to fix this limitation.

license

MIT. Copyright (c) Feross Aboukhadijeh, John Hiesey & Jan Schr.

chrome-net open pull requests (View All Pulls)
  • destroy callback not getting called
chrome-net questions on Stackoverflow (View All Questions)
  • ajax request not working in google chrome - net::ERR_INCOMPLETE_CHUNKED_ENCODING
  • Chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING error
  • Unable to surf to twitter with chrome: NET: ERR_CERT_AUTHORITY_INVALID
  • Chrome: net::ERR_INSECURE_RESPONSE when using corsproxy over HTTPS
  • GET request not working on Chrome --> net::ERR_CONTENT_LENGTH_MISMATCH
  • Chrome .Net Ui Automation - Automatic Sign on to Browser - AutomationElement Invoke appears to invoke with no result
  • Not getting the data form json file in chrome net::ERR_FILE_NOT_FOUND
  • Error when accessing localhost api in chrome net::ERR_INSECURE_RESPONSE
  • how to access chrome net-internals from the chrome extension code
chrome-net list of languages used
Other projects in JavaScript