0

Having trouble with this...

rpc:call('app@anothernode',module,function,args)

..from within a .yaws file.

('module' just returns an ehtml snippet)

The issue is I can't find where to set the erlang magic cookie in order to connect to the other node 'anothernode'.

If I start yaws with something like 'yaws -sname yaws' and then issue this...

erlang:set_cookie(node(),erlang_magic_cookie).

then sure I can ping the other node and then issue the rpc call (from within the yaws node ) and it connects and returns the snippet.

I've read the yaws doco pdf, searched the stackoverflow forums and googled it without success.

Question: how do I tell yaws that the erlang magic cookie is 'erlang_magic_cookie' ?

mbrain ?

thanks

2 Answers2

0

Yes, running this particular node on Windows so gave up and just put the file '.erlang.cookie' containing the magic cookie into the C:\Documents and Settings\TheUser folder.

0

You could put 'erlang_magic_cookie' in your yaws.conf server section within the opaque section.

Then create a module then gets started using a start_mod= line in the server configuration. This will call yourmodule:start(SConf).

The #sconf record has an opaque section that is a list of tuples. Read your cookie value from that and set it.

See the yaws.conf manpage for details on start_mod and opaque data.

I have not used this method myself, but I have used start_mod to start my own module with passed configuration from yaws.conf.

mp3foley
  • 695
  • 5
  • 10