Search in sources :

Example 1 with EmbedHttpServer

use of org.pdown.gui.http.EmbedHttpServer in project proxyee-down by monkeyWie.

the class DownApplication method initEmbedHttpServer.

private void initEmbedHttpServer() {
    countDownLatch = new CountDownLatch(1);
    new Thread(() -> {
        EmbedHttpServer embedHttpServer = new EmbedHttpServer(API_PORT);
        embedHttpServer.addController(new NativeController());
        embedHttpServer.addController(new ApiController());
        embedHttpServer.addController(new PacController());
        embedHttpServer.start(future -> countDownLatch.countDown());
    }).start();
}
Also used : URL(java.net.URL) ApiController(org.pdown.gui.http.controller.ApiController) LoggerFactory(org.slf4j.LoggerFactory) PacController(org.pdown.gui.http.controller.PacController) Browser(org.pdown.gui.com.Browser) PathUtil(org.pdown.rest.util.PathUtil) PopupMenu(java.awt.PopupMenu) ConfigContent(org.pdown.rest.content.ConfigContent) Application(javafx.application.Application) TrayIcon(java.awt.TrayIcon) ExecUtil(org.pdown.gui.util.ExecUtil) URI(java.net.URI) SystemTray(java.awt.SystemTray) JarURLConnection(java.net.JarURLConnection) Method(java.lang.reflect.Method) Path(java.nio.file.Path) I18nUtil(org.pdown.gui.util.I18nUtil) Rectangle2D(javafx.geometry.Rectangle2D) PosixFilePermission(java.nio.file.attribute.PosixFilePermission) Image(java.awt.Image) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) HttpDownAppCallback(org.pdown.gui.rest.HttpDownAppCallback) Set(java.util.Set) Screen(javafx.stage.Screen) RestWebServerFactoryCustomizer(org.pdown.rest.content.RestWebServerFactoryCustomizer) Platform(javafx.application.Platform) CountDownLatch(java.util.concurrent.CountDownLatch) Dimension(java.awt.Dimension) MenuItem(java.awt.MenuItem) AWTException(java.awt.AWTException) Toolkit(java.awt.Toolkit) Scene(javafx.scene.Scene) HttpDownRestCallback(org.pdown.rest.controller.HttpDownRestCallback) Components(org.pdown.gui.com.Components) ServerConfigInfo(org.pdown.rest.entity.ServerConfigInfo) PosixFilePermissions(java.nio.file.attribute.PosixFilePermissions) URLConnection(java.net.URLConnection) DownRestServer(org.pdown.rest.DownRestServer) ExtensionContent(org.pdown.gui.extension.ExtensionContent) Desktop(java.awt.Desktop) NativeController(org.pdown.gui.http.controller.NativeController) Logger(org.slf4j.Logger) Files(java.nio.file.Files) ExtensionProxyUtil(org.pdown.gui.extension.mitm.util.ExtensionProxyUtil) IOException(java.io.IOException) JOptionPane(javax.swing.JOptionPane) File(java.io.File) ConfigUtil(org.pdown.gui.util.ConfigUtil) EmbedHttpServer(org.pdown.gui.http.EmbedHttpServer) Stage(javafx.stage.Stage) AppUtil(org.pdown.gui.util.AppUtil) Paths(java.nio.file.Paths) OsUtil(org.pdown.core.util.OsUtil) PDownConfigContent(org.pdown.gui.content.PDownConfigContent) StringUtils(org.springframework.util.StringUtils) CountDownLatch(java.util.concurrent.CountDownLatch) ApiController(org.pdown.gui.http.controller.ApiController) NativeController(org.pdown.gui.http.controller.NativeController) PacController(org.pdown.gui.http.controller.PacController) EmbedHttpServer(org.pdown.gui.http.EmbedHttpServer)

Aggregations

AWTException (java.awt.AWTException)1 Desktop (java.awt.Desktop)1 Dimension (java.awt.Dimension)1 Image (java.awt.Image)1 MenuItem (java.awt.MenuItem)1 PopupMenu (java.awt.PopupMenu)1 SystemTray (java.awt.SystemTray)1 Toolkit (java.awt.Toolkit)1 TrayIcon (java.awt.TrayIcon)1 File (java.io.File)1 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 JarURLConnection (java.net.JarURLConnection)1 URI (java.net.URI)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 PosixFilePermission (java.nio.file.attribute.PosixFilePermission)1