mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 09:05:54 +03:00
[GH-ISSUE #1843] Getting It seems your host/port is invalid, please double check the Map Remote Config #1835
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1835
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rakeshkarkare on GitHub (Nov 9, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1843
Originally assigned to: @NghiaTranUIT on GitHub.
Description
Getting 403 for responses after mocking and using automation script
I am using Python script to automate mobile apps. I am trying intercept responses of server, by mocking responses using flask server and proxyman
Sometimes the proxyman is giving 403 status code If I run mobile app along with flask mock server through automation script
But, if I manually run the flask server and open mobile app manually same script is working. Looks like there is some delay from proxyman in order to mock responses through script bcoz I can see the response showing in proxyman is slow.
Note : I am trying to kill the proxyman app and relaunch again in order to import rule for specific endpoint to validate the use case on UI after response is mocked
Current Behavior
Getting 403 for responses after mocking and using automation script
Also observed in response for the particular endpoint other than status code the headers in response showing as content-length -as 0 and Server as AirTunes/675.4.1
Expected Behavior
It should work and send response with proper status which was used in mocking
Environment
@rakeshkarkare commented on GitHub (Nov 9, 2023):
Please let me know if any settings needed to do in proxyman app bcoz same works and gets mocked with proper response if I give time.sleep in my script
@rakeshkarkare commented on GitHub (Nov 9, 2023):
I tried to google the problem did disable the Airplay receiver now getting 500 error with below response
{
"remote_url": "localhost.proxyman.io:5000",
"error": "Request Timeout",
"note": "It seems your host/port is invalid, please double check the Map Remote Config"
}
@rakeshkarkare commented on GitHub (Nov 9, 2023):
I tried modifying the etc/hosts file but no luck, still facing same issue. Tried repeating the request with proxyman got below error
{
"remote_url": "localhost:5050",
"error": "Request Timeout",
"note": "It seems your host/port is invalid, please double check the Map Remote Config"
}
@rakeshkarkare commented on GitHub (Nov 9, 2023):
I am using appium server listening on 4723 and localhost while running test alongwith above proxyman configuration. Please help
@NghiaTranUIT commented on GitHub (Nov 10, 2023):
Can you illustrate how your config?
From your explanation, it's: Your mobile client -> Make a request to Proxyman -> Proxyman uses Map Remote and proxies to your Python Script? 🤔 If you're using Map Remote, can you share with me your config? and the URL it's mapped too.
@rakeshkarkare commented on GitHub (Nov 10, 2023):
I am using flask as a mock server to mock responses in my mobile app script and proxyman to intercept the request and map the endpoint to my flask local host. Please find below map report config. Note: I modified the endpoint url from rule to share here
Same script works If I use flask directly with proxyman without appium server running. And Manually opening mobile app. But, If I start appium server it gives the error.
{ "mapRemoteData": { "data": "WwogICAgewogICAgICAgICJpZCI6ICJEQUUzNTA1OC1GNkUxLTQzQzMtOTgzQi0xOUNBMjREOTI5MDUiLAogICAgICAgICJuYW1lIjogIlVudGl0bGVkIiwKICAgICAgICAicHJlc2VydmVPcmlnaW5hbFVSTCI6IGZhbHNlLAogICAgICAgICJyZWdleCI6ICJ1c2VXaWxkY2FyZCIsCiAgICAgICAgImdyYXBoUUxRdWVyeU5hbWUiOiBudWxsLAogICAgICAgICJpc0VuYWJsZWQiOiB0cnVlLAogICAgICAgICJmcm9tVVJMQ29tcG9uZW50IjogewogICAgICAgICAgICAicGF0aCI6ICIiLAogICAgICAgICAgICAicXVlcnkiOiAiIiwKICAgICAgICAgICAgImhvc3QiOiAiIiwKICAgICAgICAgICAgInNjaGVtZSI6ICIiLAogICAgICAgICAgICAicG9ydCI6ICIiCiAgICAgICAgfSwKICAgICAgICAicHJlc2VydmVIb3N0SGVhZGVyIjogZmFsc2UsCiAgICAgICAgIm1hcEZyb21VUkwiOiAiaHR0cHM6XC9cL3NlcnZlci1kb21haW5cL3Rlc3RcL0FwcENsaWVudFwvMi4wXC9hY2NvdW50IiwKICAgICAgICAiaXNJbmNsdWRpbmdQYXRocyI6IGZhbHNlLAogICAgICAgICJ0b1VSTENvbXBvbmVudCI6IHsKICAgICAgICAgICAgInBhdGgiOiAiIiwKICAgICAgICAgICAgInF1ZXJ5IjogIiIsCiAgICAgICAgICAgICJob3N0IjogImxvY2FsaG9zdCIsCiAgICAgICAgICAgICJzY2hlbWUiOiAiaHR0cCIsCiAgICAgICAgICAgICJwb3J0IjogIjUwNTAiCiAgICAgICAgfSwKICAgICAgICAibWV0aG9kIjogewogICAgICAgICAgICAiZXhhY3QiOiBbCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgIm5hbWUiOiAiUE9TVCIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgXQogICAgICAgIH0KICAgIH0KXQ==", "isEnabled": true } }@NghiaTranUIT commented on GitHub (Nov 10, 2023):
Can you try with two advanced settings?
Hostheader and URL will be changed -> Your client can reject the Request because theHostis different than the actual URL@rakeshkarkare commented on GitHub (Nov 10, 2023):
But same is working if I am not running appium server to test mobile app through automation, and invoking mobile app manually and mocking the responses with flask via proxyman 🤔
My appium server running on localhost with port 4723
How to try this advanced settings ?
@rakeshkarkare commented on GitHub (Nov 10, 2023):
I tried advanced settings but it still gives me same error
@NghiaTranUIT commented on GitHub (Nov 10, 2023):
This error means Proxyman can't connect to a localhost:5050, it's time-out.
Can you modify the /ect/host file and add new alias? for example:
127.0.0.1 proxyman.debug, then opening your Map Remote rule -> Change the Map To: Host =proxyman.debug?@rakeshkarkare commented on GitHub (Nov 10, 2023):
Still same error
@NghiaTranUIT commented on GitHub (Nov 10, 2023):
Then, it's your localhost:5050 server problem because Proxyman can't correct to it, it got the timeout after 30 seconds.
@rakeshkarkare commented on GitHub (Nov 10, 2023):
But same script works if I stop appium server. Is there way to increase timeout in proxyman
@rakeshkarkare commented on GitHub (Nov 10, 2023):
Still failing with same error but script works and mocks the responses as intended if appium server is stopped. @NghiaTranUIT Any idea what could be the reason ?
@rakeshkarkare commented on GitHub (Nov 16, 2023):
I was able to resolve this issue, by launching flask in another module in script, and using the routes in same script.
Now, able to mock responses as expected.
Thanks for the support @NghiaTranUIT