Specify source ip using fsockopen

前端 未结 2 429
难免孤独
难免孤独 2020-12-20 22:27

On a server with multiple IPs routed to it, I\'d like to use PHP\'s fsockopen to open from a non-primary-interface ip (or a comparable method to be able to make fread and fw

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-20 23:09

    With the standard arguments offered, it may not be possible.

    This article (see: http://bytes.com/topic/php/answers/568317-specify-source-address-interface-use-when-using-fsockopen) suggests that you have to go down a level and use socket_bind().

提交回复
热议问题