Socket
Book a DemoInstallSign in
Socket

stud-proxy

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stud-proxy

Round Robin proxy/balancer for the stud TLS terminator

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

stud-proxy

Round Robin proxy/balancer for the stud TLS terminator

Getting Started

Get stud. Run with --write-ip, THIS IS NOT OPTIONAL.

var s = studproxy()
s.listen(8000, function () {
  request('https://localhost:8443/', function (e, resp, body) {
    // Will return a response from a round robin host.
  })
})
s.robin([['98.139.127.62', 80]])

If you need to get your list of round robin hosts from a remote server stud-proxy will queue all the incoming requests and buffering the data in to memory until you set the round robin hosts.

var s = studproxy()
s.listen(8000, function () {
  request('https://localhost:8443/', function (e, resp, body) {
    // Will return a response from a round robin host.
  })
})
setTimeout(function () {
  s.robin([['98.139.127.62', 80]])
}, 1000)

You can reset the round robin hosts at any time by calling .robin().

If you don't want to do a simple round robin you can pass a custom handler.

var s = studproxy(function (socket, ip, chunk) {
  console.error('New connection from '+ip)
  socket.pipe(net.connect(80)).pipe(socket)
  if (chunk) socket.write(chunk)
})

Keep in mind that this customization doesn't not include the connection queues and buffering available when using round robin.

TODO

  • Support IPv6
  • Benchmarks (this is a pure TCP proxy so they'll be fairly impressive)

FAQs

Package last updated on 10 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts