mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-07 00:15:55 +08:00
Support Unicode encode
This commit is contained in:
@@ -48,8 +48,6 @@ class ConnectionHandler(
|
||||
*/
|
||||
@Throws(IOException::class)
|
||||
fun handlePacket(stream: ByteBuffer) {
|
||||
val rawPacket = ByteArray(stream.limit())
|
||||
stream[rawPacket, 0, stream.limit()]
|
||||
stream.rewind()
|
||||
|
||||
val ipHeader = IPPacketFactory.createIP4Header(stream)
|
||||
@@ -105,7 +103,7 @@ class ConnectionHandler(
|
||||
* 是否支持协议
|
||||
*/
|
||||
private val methods: List<String> =
|
||||
mutableListOf("GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE", "CONNECT")
|
||||
mutableListOf("GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "TRACE", "CONNECT", "PROPFIND", "REPORT")
|
||||
|
||||
private fun supperProtocol(packetData: ByteBuffer): Boolean {
|
||||
val position = packetData.position()
|
||||
|
||||
@@ -63,11 +63,7 @@ class ProxyVpnThread(
|
||||
if (length > 0) {
|
||||
try {
|
||||
readBuffer.flip()
|
||||
val byteArray = ByteArray(length)
|
||||
readBuffer.get(byteArray)
|
||||
|
||||
val packet = ByteBuffer.wrap(byteArray)
|
||||
handler.handlePacket(packet)
|
||||
handler.handlePacket(readBuffer)
|
||||
} catch (e: Exception) {
|
||||
val errorMessage = (e.message ?: e.toString())
|
||||
Log.e(TAG, errorMessage, e)
|
||||
|
||||
@@ -9,9 +9,6 @@ import java.nio.ByteOrder
|
||||
|
||||
/**
|
||||
* Helper class to perform various useful task
|
||||
*
|
||||
* @author Borey Sao
|
||||
* Date: May 8, 2014
|
||||
*/
|
||||
object PacketUtil {
|
||||
@get:Synchronized
|
||||
|
||||
Reference in New Issue
Block a user