A bi-directional transmitting and receiving device for the connection of optical fiber is mainly to apply one side of a T shape shell to connect an optical fiber, while another side of the shell in line with the optical fiber is arranged an optical transmitter, with an optical receiver being arranged at the third side of the shell, wherein the optical transmitter is a packaging structure of Transistor Outline can (TO-can) having a cup shape lid, of which underside is inclined 45 degrees to transmitted light beam, and wherein a hollow window in the underside of the lid is arranged a light splitting filter, which is just positioned at the beam path of the optical receiver.