code: public static Connector getConnector(ServletWebServerApplicationContext applicationContext) {
          final TomcatWebServer container = (TomcatWebServer) applicationContext.getWebServer();
  
          // Start the container to make sure all connectors are available.
          container.start();
          return container.getTomcat().getConnector();
      }
docs: Extracts a Tomcat {@link Connector} from Spring webapp context.