mscdex / socksv5

SOCKS protocol version 5 server and client implementations for node.js
MIT License
401 stars 120 forks source link

Avoid dynamic require to support using it in chrome app runtime by browserify #3

Open hackwaly opened 9 years ago

hackwaly commented 9 years ago

The "index.js" file breaks browserify. Could you please change it to static require? Currently I have to manually fixed as follow.

var fs = require('fs'),
    path = require('path');

[
  require('./lib/server'),
  require('./lib/client'),
  require('./lib/Agents')
].forEach(function(exp) {
  var keys = Object.keys(exp);
  for (var i = 0, len = keys.length; i < len; ++i)
    exports[keys[i]] = exp[keys[i]];
});

exports.auth = {
  None: require('./lib/auth/None'),
  UserPassword: require('./lib/auth/UserPassword')
};
mscdex commented 9 years ago

I'd be open to a PR to fix it. The auth methods should probably be done similarly at least for consistency.

kennysong commented 9 years ago

Had the same issue as above. I can help fix this, but is there relevant documentation somewhere about why the current index.js doesn't work? I'm not super familiar with the internals of require and browserify.

darky commented 8 years ago

@mscdex, can you simply copypaste @hackwaly code, release new version and close this issue? It can be done via browser through github. You spent time on this slightly more than read this message.

darky commented 8 years ago

Afraid npm publish Ok, this spent time slighly more than slighly more than read prev message

reverofevil commented 7 years ago

@mscdex Could you mark in a README that the project is abandoned and is looking for a new maintainer?