-
Notifications
You must be signed in to change notification settings - Fork 43
cli modeでの操作機能を追加 #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli modeでの操作機能を追加 #206
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| /***/*.sqlite3 | ||
| /***/*.class | ||
| /***/.DS_Store | ||
| /.kotlin | ||
|
|
||
| # jenv | ||
| .java-version | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,9 @@ | ||
| pluginManagement { | ||
| plugins { | ||
| id 'org.jetbrains.kotlin.jvm' version '2.2.0' | ||
| } | ||
| } | ||
| plugins { | ||
| id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' | ||
| } | ||
| rootProject.name = "PacketProxy" |
This file was deleted.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. このファイルも復活させてください |
This file was deleted.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. このファイルですが、現在PacketProxyを利用している人が、kotlinの環境を整えないとコンパイルできなくなってしまうので、もとのJavaファイルに戻してもらえると助かります。 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* | ||
| * Copyright 2025 DeNA Co., Ltd. | ||
| * | ||
| * Licensed 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 packetproxy | ||
|
|
||
| import java.net.ServerSocket | ||
| import packetproxy.common.I18nString | ||
| import packetproxy.model.ListenPort | ||
| import packetproxy.util.Logging | ||
|
|
||
| object ProxyFactory { | ||
| @JvmStatic | ||
| @Throws(Exception::class) | ||
| fun create(listenInfo: ListenPort): Proxy { | ||
| val type = listenInfo.getType() | ||
| val port = listenInfo.getPort() | ||
|
|
||
| Logging.log("type is $type") | ||
| Logging.log(I18nString.get("Start listening port %d.", port)) | ||
|
|
||
| return when (type) { | ||
| ListenPort.TYPE.UDP_FORWARDER -> ProxyUDPForward(listenInfo) | ||
| ListenPort.TYPE.QUIC_FORWARDER -> ProxyQuicForward(listenInfo) | ||
| ListenPort.TYPE.QUIC_TRANSPARENT_PROXY -> ProxyQuicTransparent(listenInfo) | ||
|
|
||
| else -> { | ||
| val listenSocket = ServerSocket(port) | ||
|
|
||
| when (type) { | ||
| ListenPort.TYPE.HTTP_PROXY -> ProxyHttp(listenSocket, listenInfo) | ||
| ListenPort.TYPE.SSL_FORWARDER -> ProxySSLForward(listenSocket, listenInfo) | ||
| ListenPort.TYPE.HTTP_TRANSPARENT_PROXY -> ProxyHttpTransparent(listenSocket, listenInfo) | ||
| ListenPort.TYPE.SSL_TRANSPARENT_PROXY -> ProxySSLTransparent(listenSocket, listenInfo) | ||
|
|
||
| else -> { | ||
| listenSocket.setReuseAddress(true) | ||
|
|
||
| when (type) { | ||
| ListenPort.TYPE.XMPP_SSL_FORWARDER -> ProxyXmppSSLForward(listenSocket, listenInfo) | ||
| else -> ProxyForward(listenSocket, listenInfo) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このファイルは復活させてもらえると