The lightning:container component hosts content in an iframe. You can implement communication to and from the framed application, allowing it to interact with the Lightning component. lightning:container provides the message() method, which you can use in the JavaScript controller to send messages to the application. In the component, specify a method for handling messages with the onmessage attribute.