当前位置: 首页>>代码示例>>Java>>正文


Java HttpServerOptions.setCompressionSupported方法代码示例

本文整理汇总了Java中io.vertx.core.http.HttpServerOptions.setCompressionSupported方法的典型用法代码示例。如果您正苦于以下问题:Java HttpServerOptions.setCompressionSupported方法的具体用法?Java HttpServerOptions.setCompressionSupported怎么用?Java HttpServerOptions.setCompressionSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.core.http.HttpServerOptions的用法示例。


在下文中一共展示了HttpServerOptions.setCompressionSupported方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configSSL

import io.vertx.core.http.HttpServerOptions; //导入方法依赖的package包/类
private HttpServerOptions configSSL(JsonObject conf) {
	String ssl_keystore= conf.getString("ssl.keystore");
	String keystore_pass = conf.getString("ssl.keystore.pass");

	String ssl_client_keystore= conf.getString("ssl.client.keystore");
	String client_keystore_pass = conf.getString("ssl.client.keystore.pass");		
	
	HttpServerOptions options = new HttpServerOptions();
	options.setCompressionSupported(true);
	
	if(S.isNotBlank(ssl_keystore) && S.isNotBlank(keystore_pass)){
		options.setSsl(true).setKeyStoreOptions(
				new JksOptions().setPath(ssl_keystore).setPassword(keystore_pass));
		
		if(S.isNotBlank(ssl_client_keystore) && S.isNotBlank(client_keystore_pass))
			options.setClientAuth(ClientAuth.REQUIRED).setTrustStoreOptions(
			    new JksOptions().setPath(ssl_client_keystore).setPassword(client_keystore_pass));
	}
	return options;
}
 
开发者ID:troopson,项目名称:etagate,代码行数:21,代码来源:OutServerVerticle.java

示例2: configureHttpServer

import io.vertx.core.http.HttpServerOptions; //导入方法依赖的package包/类
private void configureHttpServer(VertxContext vertxContext, Future<HttpServerOptions> future) {
    HttpServerOptions httpServerOptions = new HttpServerOptions();
    httpServerOptions.setPort(vertxContext.config().getInteger(HTTP_PORT_KEY, DEFAULT_PORT));
    ServiceLoader<HttpServerConfigurator> configurators = ServiceLoader.load(HttpServerConfigurator.class);
    configurators.forEach(c -> c.configureHttpServer(vertxContext, httpServerOptions));
    httpServerOptions.setCompressionSupported(true);

    future.complete(httpServerOptions);
}
 
开发者ID:GwtDomino,项目名称:domino,代码行数:10,代码来源:DominoLoader.java

示例3: start

import io.vertx.core.http.HttpServerOptions; //导入方法依赖的package包/类
public void start() throws Exception {

		JsonObject conf = vertx.getOrCreateContext().config();
		
		HttpServerOptions options =  new HttpServerOptions();
		options.setCompressionSupported(true);		
		
		HttpServer server = vertx.createHttpServer(options);
				
		/*
		    <property name="inside.host">172.18.7.20</property>
   			<property name="inside.port">8999</property>
		 */
		String host = conf.getString("inside.host");
		String port = conf.getString("inside.port");		
		
		if(S.isBlank(host) || S.isBlank(port))
			return;

		// ============初始化======================

		this.upload_dir = conf.getString("upload.dir");

		this.webclient = WebClient.create(vertx);

		this.appContain = gsetting.getAppContain(vertx,this.webclient);
						 
		this.initRoutes();
		
		server.requestHandler(router::accept);
		server.listen(Integer.parseInt(port), host,ar -> {
			if (ar.succeeded()) {
				log.info("InsideServer listen on " + port);
			} else {
				log.error("InsideServer Failed to start!", ar.cause());
			}
		});		

	}
 
开发者ID:troopson,项目名称:etagate,代码行数:40,代码来源:InsideServerVerticle.java

示例4: start

import io.vertx.core.http.HttpServerOptions; //导入方法依赖的package包/类
@Before
public void start(TestContext context) {

	super.before(context);

	Router router = new RestBuilder(vertx)
		                .register(StaticFileRest.class)
		                .build();

	RestRouter.notFound(router, "rest", RestNotFoundHandler.class);

	HttpServerOptions serverOptions = new HttpServerOptions();
	serverOptions.setCompressionSupported(true);



	vertx.createHttpServer(serverOptions)
	     .requestHandler(router::accept)
	     .listen(PORT);
}
 
开发者ID:zandero,项目名称:rest.vertx,代码行数:21,代码来源:StaticFileTest.java


注:本文中的io.vertx.core.http.HttpServerOptions.setCompressionSupported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。