Enable runtime reconciliation proxies in node.js

I have a small RPC library for node, and now it uses proxies for remote objects, if available (by checking for the existence of a Proxy global).

I would like for reconciliation proxies to be enabled at runtime, that is, in a node process that did not start with the --harmony-proxy flag. Is it possible?

I understand that there are good reasons not to do this, and I don't care :-P

EDIT As indicated in the answers, node.js proxies use an older specification. I can use a padding, for example https://github.com/tvcutsem/harmony-reflect , but this requires the --harmony flag to enable basic proxy support and I want to know if this can be enabled at runtime in the process running without flags --harmony .

+2
source share
2 answers

The proxy version depends on whether you use master or v0.10 . The latter stable ( v0.10 ) uses the 3.14 branch, and development ( master ) stays with v8 bleeding_edge (currently at 3.20 ). Therefore, the more correct question is: "What version of the proxy is implemented by v8?"

Work on the implementation of the proxy server is ongoing, but now it is a moving target. The link to the proxy implementation ticket in the error tracker ( http://code.google.com/p/v8/issues/detail?id=1543 ) looks like the next round of changes. Therefore, be careful with the upcoming development.

As for enabling proxies in the application, and not on the command line, I believe that you will have to write your own module and use the V8::SetFlagsFromString ( https://github.com/v8/v8/blob/f281162/include/v8 method . h # L4341-L4344 ). If you need an example, I could take the time to crack it.

+3
source

Node.js implements the older proxy specification. Do not use them.

https://groups.google.com/forum/?fromgroups=#!topic/nodejs/LPD8ut33-hg

+2
source

All Articles