/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cn.exlive.exbooter.configure; import com.google.common.collect.Sets; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.cloud.netflix.zuul.filters.SimpleRouteLocator; import org.springframework.cloud.netflix.zuul.filters.ZuulProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.HashSet; import java.util.Map; import java.util.Optional; import java.util.Set; /** * * Http 代理, WebSocket 代理 * *
* * Created by zhenqin. * User: zhenqin * Date: 2022/4/25 * Time: 下午7:08 * ** * @author zhenqin */ @Slf4j @Setter @Getter @Configuration public class ApiGatewayConfig implements InitializingBean { @Autowired ApiRouteProperties apiRouteProperties; @Autowired ServerProperties serverProperties; @Autowired ZuulProperties zuulProperties; @Override public void afterPropertiesSet() throws Exception { final Map