显示Erlang中的连接特定Cookie [英] Display connection specific cookies in Erlang

查看:315
本文介绍了显示Erlang中的连接特定Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在具有 erlang:set_cookie / 2 的节点上设置Cookie时,可以为不同的节点设置不同的Cookie。是否有任何方式显示,哪个Cookie为哪个节点设置?



调用 erlang:get_cookie / 1 不显示此信息,只显示默认cookie。 / p>

示例:



启动带有cookie的NodeA foo 一个带有cookie的节点B bar 。在NodeA上,通过调用 erlang:set_cookie(NodeB,bar)通过NodeB通信到$ code> bar 。 Pinging现在工作正常,没有连接尝试从不允许的节点...错误。在NodeA上调用 erlang:get_cookie(),但仍显示默认cookie foo 。如何找到为NodeB设置哪个cookie?

解决方案

似乎没有记录,但 auth:get_cookie / 1 做你想要的对于您的情况,您可以在 NodeA 上调用 auth:get_cookie(NodeB)


When setting a cookie on a node with erlang:set_cookie/2 it is possible to set different cookies for different nodes. Is there any way to display, which cookie is set for which node?

Calling erlang:get_cookie/1 does not display this information, only the "default" cookie is displayed.

Example:

Start NodeA with cookie foo and a NodeB with cookie bar. At NodeA now set the cookie to use when communicating with NodeB to bar by calling erlang:set_cookie(NodeB, bar). Pinging now works fine, no "Connection attempt from disallowed node..." errors. Calling erlang:get_cookie() on NodeA however still shows the "default" cookie foo. How can find which cookie is set for NodeB?

解决方案

It doesn't seem to be documented, but auth:get_cookie/1 does what you want. For your case, you can call auth:get_cookie(NodeB) on NodeA.

这篇关于显示Erlang中的连接特定Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆