使用node.js将值传递给代理页面

我有这个代码从客户端网站获取值:

var server = ws.createServer(function(conn){ console.log("New Connection"); //on text function conn.on("text", function(str){ /* here i was to take that value in the str and pass it to html file which is path "agent/index.html"*/ }); }).listen(process.env.PORT, process.env.IP); 

我想在agent / index.html文件中使用这个str值,并用它做一些事情。

这个str值来自于一个使用websockets的远程用户网站,现在我想把这个值传递给代理,这个代理立即回复它,它是一个实时聊天应用程序。

请检查评论。

你有一堆select。 Cookies,localstorage,URL参数,POST数据并存储(可能不build议)。

如果你只想要那个页面的数据,我只需要使用URL参数。 在你的函数里面,将用户redirect到agent / index.html?text = str和index.html,检索URL参数,然后按照你的喜好进行操作。