mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
20 lines
491 B
JavaScript
20 lines
491 B
JavaScript
if (Meteor.isServer) {
|
|
Meteor.publish("clientInfo", function () {
|
|
var self = this;
|
|
self.added("clientInfo", "info", {
|
|
clientAddress: self.connection.clientAddress,
|
|
httpHeaders: self.connection.httpHeaders
|
|
});
|
|
self.ready();
|
|
});
|
|
}
|
|
|
|
if (Meteor.isClient) {
|
|
Meteor.subscribe("clientInfo");
|
|
var ClientInfo = new Mongo.Collection("clientInfo");
|
|
|
|
Template.info.info = function () {
|
|
return EJSON.stringify(ClientInfo.findOne("info"), {indent: true});
|
|
};
|
|
}
|