socksv5 icon indicating copy to clipboard operation
socksv5 copied to clipboard

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

Open hackwaly opened this issue 10 years ago • 5 comments

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')
};

hackwaly avatar Jan 22 '15 04:01 hackwaly

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

mscdex avatar Mar 15 '15 00:03 mscdex

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.

kennysong avatar Aug 06 '15 18:08 kennysong

@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 avatar Mar 04 '16 18:03 darky

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

darky avatar Mar 04 '16 18:03 darky

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

reverofevil avatar Apr 13 '17 19:04 reverofevil