how to specify host with port in cypress
# i-need-help
f
Hi all, i am trying to run cypress test on local environment. When we start our app locally. We start chrome by mapping some domains with ip and port. Something like this. Image 1 Now when i run my test in cypress and points to this dev-local domain by giving 8000 port in baseurl. I am able to load the page but some of the js calls still calls the domain without using the port like this _ image 2 How can i specify port to internal calls?

https://cdn.discordapp.com/attachments/1110919578495762553/1110919869735649313/20230524_181929.jpg

https://cdn.discordapp.com/attachments/1110919578495762553/1110919870138290278/20230524_182415.jpg

f
I'm not sure if i understand the question. Do you intercept fetches? And does it affect your test ? Cypress does not send any requests thats your application cypress only triggers certain calls by visiting page, but it is not like that cypress just sends a request unless you specified that specifically
f
Internal calls that app made in the background like a xhr call (not cypress) . How can we specify the port for them because we can only specify port for the base url and we can only specify ip address for a domain but port is something i am not able to specify. In above example i have specified 8000 as port for baseurl and domain also i set to some ip in cypress config file. But background calls are still refering to the ip address without port hence not able to fetch the data.
g
you should provide a small reproducible example. In my lesson https://cypress.tips/courses/network-testing/lessons/bonus104 I do the same and the app makes fetch calls, but they are correctly just going back to the base url.