Construction of the first infrared beamline BL01B1 at Shanghai Synchrotron Radiation Facility (SSRF) was completed at the end of 2013. The IR beamline collects both edge radiation (ER) and bending magnet radiation (BMR) from a port, providing a solid angle of 40mrad and 20mrad in the horizontal and vertical directions, respectively. The optical layout of the infrared beamline and the design of the extraction mirror are described in this paper. A calculation of the beam propagation has been used to optimize the parameters of the optical components. The photon flux and spatial resolution have been measured at the end-station, and the experimental results are in good agreement with the theoretical calculation.