monkeyWie / proxyee

HTTP proxy server,support HTTPS&websocket.MITM impl,intercept and tamper HTTPS traffic.
MIT License
1.53k stars 573 forks source link

如何获取POST请求参数 #80

Closed william-abel closed 4 years ago

william-abel commented 4 years ago

如何获取POST请求参数,例如下面图片中的Form Data的数据image

monkeyWie commented 4 years ago

从请求体里面拿就好了,参考 https://github.com/monkeyWie/proxyee/blob/master/src/test/java/com/github/monkeywie/proxyee/InterceptFullRequestProxyServer.java

william-abel commented 4 years ago

从请求体里面拿就好了,参考https://github.com/monkeyWie/proxyee/blob/master/src/test/java/com/github/monkeywie/proxyee/InterceptFullRequestProxyServer.java

Debug 进入不了handelRequest 在哪个方法里拿参数?

monkeyWie commented 4 years ago

你可能需要重写match方法,匹配到的请求才会被拦截 image

william-abel commented 4 years ago

你可能需要重写match方法,匹配到的请求才会被拦截 image

谢谢 已经获取到参数了 还有一个小问题 打包成jar java -jar 运行一直是 jar中没有主清单属性

monkeyWie commented 4 years ago

你怎么打的jar包啊,要打成可运行的jar才行

william-abel commented 4 years ago

你怎么打的jar包啊,要打成可运行的jar才行

通过maven 和 Idea build Artifacts 打包 都无法运行 未修改项目代码

monkeyWie commented 4 years ago

这个项目本身就不是可运行jar包啊,要打包的话需要修改pom.xml文件,示例

 <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <!-- 这里填要运行的类名 -->
                            <mainClass>lee.study.xxx.xxx</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>assembly</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
william-abel commented 4 years ago

这个项目本身就不是可运行jar包啊,要打包的话需要修改pom.xml文件,示例

 <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <!-- 这里填要运行的类名 -->
                            <mainClass>lee.study.xxx.xxx</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>assembly</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

你有其他联系方式吗 有些问题请教你

monkeyWie commented 4 years ago

加我微信吧 liwei-8466