The actual shipping risks of ordering a gun online are actually quite low. Whether you buy from a private seller or a gun shop with a Federal Firearms License to sell firearms, UPS, FED-EX, and other freight carriers will accept the shipment and deliver them to a Federal Firearms License holder who will ensure you complete a background check and transfer it to you for the previously agreed-upon fee. The shipment can be insured and is trackable like any other package.
If, however, you or your seller try to avoid the transfer fee and background check that go with using an FFL and deceive the carrier about what is in the package, you both risk criminal penalties. The carrier will ask you some questions and verify that the addressee is an FFL holder before accepting the shipment, and it is a crime to misrepresent what is in the shipment.
The rules for firearms classed as “Relics And Antiquities” are a bit different. Properly declared and certified by a seller licensed to handle such arms, they can be shipped without going through an FFL holder on the receiving end. For example, the fully functional M-1 Garland I bought from the Civilian Marksmanship Program was delivered directly to my home using the United States Postal Service’s parcel post service.