Server push lets the server preemptively "push" website assets to the client without the user having explicitly asked for them. When used with care, we can send what we know the user is going to need for the page they’re requesting.
The target must either be an absolute path (like "/path") or an absolute URL that contains a valid host and the same scheme as the parent request. If the target is a path, it will inherit the scheme and host of the parent request.
Create the main.go file and copy-paste the code below:
Run the server:
Now, open your browser's developer tools and click the Network tab. Navigate to https://127.0.0.1/, the main.jsInitiator should be Push / (index) as shown below: