  The Lagrangians and Hamiltonians of classical field theory require to
comprise gauge fields in order to be form-invariant under local gauge
transformations. These gauge fields have turned out to correctly describe
pertaining elementary particle interactions. In this paper, this principle is
extended to require additionly the form-invariance of a classical field theory
Hamiltonian under variations of the space-time curvature emerging from the
gauge fields. This approach is devised on the basis of the extended canonical
transformation formalism of classical field theory which allows for
transformations of the space-time metric in addition to transformations of the
fields. Working out the Hamiltonian that is form-invariant under extended local
gauge transformations, we can dismiss the conventional requirement for gauge
bosons to be massless in order for them to preserve the local gauge
invariance.The emerging equation of motion for the curvature scalar turns out
to be compatible with the Einstein equation in the case of a static gauge
field. The emerging equation of motion for the curvature scalar R turns out to
be compatible with that from a Proca system in the case of a static gauge
field.
