如何在Meteor中访问客户端IP地址? [英] How to access client IP address in Meteor?

查看:103
本文介绍了如何在Meteor中访问客户端IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个非常基本的问题,没有优雅的解决方案/答案。

This seems like a very basic question that doesn't have an elegant solution/answer out there.

如何从(1)服务器或(2)客户端访问客户端(远程)IP地址?

How can I access the client (remote) IP address from (1) the server or (2) the client?

推荐答案

正如Florin所说,现在这几乎与Meteor融为一体,而不是我们自己必须做的黑暗时代。但是,我还将它包装在跟踪所有打开连接的包中,并允许您查询其IP: https://github.com/mizzao/meteor-user-status 。它还有许多其他有用的东西。

As Florin mentioned, this is all pretty much integrated with Meteor now, as opposed to the dark ages when we had to do it ourselves. However, I've additionally wrapped it in a package that tracks all open connections and allows you to query for their IPs: https://github.com/mizzao/meteor-user-status. It also does a bunch of other useful stuff.

这篇关于如何在Meteor中访问客户端IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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