self created packages -"host" attribute issue


I am currently using ppackage stuff for distributing my project and stumbled into a “feature”. When I create a package with ppackage I have to set the location there the package will be hosted using “packager.setHost(‘’)”. If I do not set it will be noted as host in the package import xml. Setting the host is not that troubling but this way see no way how I could test the packages locally first and move them to the “correct” host after that. Currently I am recreating the packages everytime with different hosts. But I guess one day a “locale” package might find its way to the “real” host which breaks the updatestuff.
So why exists this dangerous feature? Is there realy a need for placing a import xml on a different server than the package itself? Is that even possible?

I’m not sure what you’re saying.

When you build your own packages, of course you must specify the URL that will ultimately host those packages, so that the p3d file will know who to contact to download them. The import file and the package file will be hosted at the same URL; you cannot set them differently.

If you want to test with different URL’s (for instance, to create a staging area to test your projects before they are ready for general release), you can use the alt_host syntax to specify possible alternate URL’s that may be referenced by the HTML keyword alt=“alt_host”.

I don’t see anything dangerous here. What’s the problem you’re seeing?

David … import.xml <- the second line (not the require-stuff!)
If not specified host will be so i had to change it. But this version wont work for local testing (package,contents and import files in a local dir). So I have to generate the package twice; one time with the local host and the second time with the remote host. It is just a matter of time that i push a “local-version” to the remote host.
So my question is: is this host attribute (of the package tag!) useful for anything? Is it needed for storing the import.xml on a different host than the package data?

The host URL is stored in the package’s xml file, so when the p3d file is built it can read it and store the appropriate URL internally, so that the p3d file can contact the appropriate URL to download the package.

I understand your problem with the staging of the test package to another URL. There is a solution to this, this is what I tried to describe above, which is the alt_host designation.

To use alt_host, you specify the primary, customer-facing URL as the host, and you specify a private, internal URL as alt_host “test”, using something like this:

packager.addAltHost('test', '')

Now, you can build your package and host it temporarily at for testing. To download it from here, specify alt_host=“test” in the element (or for IE), or if you use the panda3d command line tool to run your p3d file, use “-t alt_host=test” on the command line. This specifies that it should download the package from the alt host indicated by “test” instead of the normal host.

When you’re satisfied with your testing, you can move your entire package, unchanged, to the live server and run it with your live HTML page, which doesn’t have the alt_host=“test” designation.

Note that you should use a real hostname, not an easily hijacked hostname like localhost, as your test URL, since any pirate with an HTML page can cause your p3d file to download its package from whatever alt host you designate. If you allow the package to be downloaded from localhost, then a hacker could conceivably hijack your p3d file to do something contemptible.