The oral polio vaccine actually did that. It used an attenuated virus that didn’t just confer immunity on the recipient; the mild infection from that weakened virus was (somewhat) transmissible to the community at large. Everyone who was directly vaccinated via OPV had a small but significant chance of infecting and thus immunizing the people around them.
Of course, there was also the problem that the attenuated vaccine occasionally mutated, and about 25 years ago, we got to the point that the vaccine was actually causing more cases of paralytic poliomyelitis than the almost entirely eradicated wild variants…
The oral polio vaccine actually did that. It used an attenuated virus that didn’t just confer immunity on the recipient; the mild infection from that weakened virus was (somewhat) transmissible to the community at large. Everyone who was directly vaccinated via OPV had a small but significant chance of infecting and thus immunizing the people around them.
Of course, there was also the problem that the attenuated vaccine occasionally mutated, and about 25 years ago, we got to the point that the vaccine was actually causing more cases of paralytic poliomyelitis than the almost entirely eradicated wild variants…