Meteor.onConnection is missing on browser



I was to find client IP address, and I found this method, but when I use it as below, browser returns error such as “Meteor.onConnection is not a function”

import { Meteor } from "meteor/meteor"
Meteor.onConnection(function(c) {


gives and it actually doesn’t have onConnection method.

Am I doing anything wrong?


It’s not as clear as it should be in the docs, but Meteor.onConnection is a server only method