How to connect to deployed server with local host?


I deployed a Meteor app at, for example,


// url = "http://localhost:3000/";
url = "";

DDPConnection = (Meteor.isClient) ? DDP.connect(url) : {};

if(Meteor.isClient) {
    // set the new DDP connection to all internal packages, which require one
    Meteor.connection = DDPConnection;
    Accounts.connection = Meteor.connection;
    Meteor.users = new Mongo.Collection('users');

    Meteor.subscribe = Meteor.connection.subscribe;

Messages = new Mongo.Collection("messages", DDPConnection);

Meteor.publish("messages", (limit=5) => {

  let options = {
    sort: [["timestamp.created", "desc"]],
    limit: limit

  return Messages.find({}, options);

Then I just do a Meteor.subscribe("messages") on the client. However, this doesn’t seem to give me my expected messages from the server. The collections are still empty on the client side…