user3765023
user3765023

Reputation: 77

Getting IP address and other connection information at Meteor Collection?

I know a way to get connection information is this.connection but this works at server-side, which requires context of server side. Some help at here, but could not find the solution. As explained here, Collection is shared both at client and server-side which is confusing me in how to get the server context or connection information at Meteor-Collection as I have used some methods in it.

Upvotes: 0

Views: 402

Answers (1)

Anthony Astige
Anthony Astige

Reputation: 1969

You may want to wrap your code to ensure it's running on the server, something like:

if (Meteor.isServer) {
    console.log(this.connection)
}

Upvotes: 0

Related Questions